<% @ Page contenttype = "text/html; charset = gb2312" Language = "Java" Import = "Java. Io. *" errorpage = "" %>
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> untitled document </title>
</Head>
<Body>
Physical path of the current web application: <% = application. getrealpath ("/") %> <br>
The physical path of the JSP file you requested: <% = application. getrealpath (request. getrequesturi () %> <br>
<%
String Path = application. getrealpath (request. getrequesturi ());
String dir = new file (PATH). getparent ();
Out. println ("physical path of the directory where the current JSP file is located" + dir + "</BR> ");
String realpath1 = "http: //" + request. getservername () + ":" + request. getserverport () + request. getcontextpath () + request. getservletpath (). substring (0, request. getservletpath (). lastindexof ("/") + 1 );
Out. println ("web URL path:" + realpath1 );
%>
</Body>
</Html>