请求路径:
http://localhost:8080/ssm/Itemsquery.action?id=2
-
request.getContextPath()
/ssm
-
request.getRequestURI()
/ssm/Itemsquery.action
-
request.getRequestURL().toString()
http://localhost:8080/Itemsquery.action
-
request.getServletPath()
/Itemsquert.action
-
D:/java/Tomcat 5.5/webapps/ssmrequest.getRealPath()
-
this.getServletContext().getRealPath()
D:/java/Tomcat 5.5/webapps/ssm
-
this.getClass().getClassLoader().getResource("").getPath()
D:/java/Tomcat 5.5/webapps/ssm/WebRoot/WEB-INF/classes/