日期:2014-05-20 浏览次数:20833 次
<%
String path1 = application.getRealPath(request.getRequestURI()); //当前请求的JSP文件的物理路径
String path2 = application.getRealPath("/"); //当前WEB应用的物理路径
String path3 = request.getRequestURI();
StringBuffer path4 = request.getRequestURL(); //getRequestURL()返回的是StringBuffer
String virtualPath = request.getServletPath(); //虚拟路径
String realPath = request.getRealPath(virtualPath);//物理路径
%>