如果你请求的URL是 http://localhost:8080/demo/Index.jsp
request.getScheme() ~~~~~~> http
request.getServerName() ~~~~~~> localhost
request.getServerPort() ~~~~~~~~~> 8080
request.getContextPath() ~~~~~~> /demo
request.getRequestPath() ~~~~~~~> /Index.jsp
request.gerRequestURI() ~~~~~~~> /demo/Index.jsp
request.getRequestURL() ~~~~~~~> http://localhost:8080/demo/Index.jsp
request.getRealPath("") ~~~~~~~~~> D:\apache-tomcat-6.0.10\webapps\demo
别人写的http://blog.csdn.net/luobo525/archive/2006/11/21/1401577.aspx
posted on 2007-09-28 09:35
Crying 阅读(497)
评论(0) 编辑 收藏 所属分类:
Jsp+Struts