<%@ page contentType=;text/html; charset=gb; language=;java; import=;javaio*; errorPage=; %>
<html>
<head>
<meta httpequiv=;ContentType; content=;text/html; charset=gb;>
<title>Untitled Document</title>
</head>
<body>
当前WEB应用的物理路径<%=applicationgetRealPath(;/;)%><BR>
当前你求请的JSP文件的物理路径<%=applicationgetRealPath(requestgetRequestURI())%><BR>
<%
String path=applicationgetRealPath(requestgetRequestURI());
String dir=new File(path)getParent();
outprintln(;当前JSP文件所在目录的物理路径;+dir+;</br>;);
String realPath = ;http://; + requestgetServerName() + ;:; + requestgetServerPort() + requestgetContextPath()+requestgetServletPath()substring(requestgetServletPath()lastIndexOf(;/;)+);
outprintln(;web URL 路径:;+realPath);
%>
</body>
</html>