标签:eal webapps uri vbscrip base http hit 区别 str
比如说有这样的一个页面
test1.jsp=======================
<a href ="test.jsp?name=wf">跳转到test2.jsp</a>
test2.jsp=======================
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
String servletPath = req.getRequestURI()
String servletPath = req.getRequestURL()
得到的值为:req.getRequestURI()-----> /test/test.jsp
req.getRequestURL()-----> http://localhost:8080/test/test.jsp
basePath :http://localhost:8080/test/
getContextPath :/test
getServletPath
:/test.jsp
getRealPath
:D:\Tomcat 6.0\webapps\test\
getServletContext().getRealPath
:D:\Tomcat 6.0\webapps\test\
getQueryString
:name=wf
HttpServletRequest 中 getRequestURL和getRequestURI的区别
标签:eal webapps uri vbscrip base http hit 区别 str
原文地址:http://www.cnblogs.com/shenxiaoquan/p/6029876.html