request取路径

request取路径
URL: http://localhost:8080/greatwall/hi.do?username=1

下面是测试的一些函数值:
request.getPathInfo()=>null
request.getContextPath()=>/greatwall
request.getLocalAddr()=>127.0.0.1
request.getLocalName()=>localhost
request.getLocalPort()=>8080
request.getPathInfo()=>null
request.getQueryString()=>username=1
request.getRealPath("/") =>C:\Program Files\apache-tomcat-6.0.18\webapps\greatwall\
request.getRequestURI() =>/greatwall/hi.do
request.getScheme() =>http
request.getServerName() =>localhost
request.getServletPath() =>/hi.do
request.getRequestURL() =>http://localhost:8080/greatwall/hi.do

你可能感兴趣的:(request取路径)