jsp 得到当前的路径

来源:互联网 发布:中国房价未来走势知乎 编辑:程序博客网 时间:2024/05/01 19:38

 <%@   page   language="java" contentType="text/html; charset=gb2312"  import="java.io.*"%>

<%
 
 
  String strAbsPath=application.getRealPath("");
 
  strAbsPath = strAbsPath + "//";
 
  strAbsPath = strAbsPath.replaceAll("////","////////");
 
 out.print("<script>alert('"+strAbsPath+"');</script>");

%> 

原创粉丝点击