php中getUri(),request.getURL()和request.getURI()

request.

getRequestURI() 返回值类似:/ServletTest/servlet/Hello

再如:

request.getContextPath() = /ServletTest

request.getLocalAddr() = 127.0.0.1

request.getPathInfo() = null

request.getPathTranslated() = null

request.getRemoteAddr() = 127.0.0.1

request.getRequestURI() = /ServletTest/servlet/Hello

request.getScheme() = http

request.getServerName() = 127.0.0.1

request.getServletPath() = /servlet/Hello

request.getClass() = class org.apache.catalina.connector.RequestFacade

request.getLocale() = zh_CN

request.getParameterMap() = {}

request.getUserPrincipal() = null

request.getRealPath("newsPub") =

D:\zfsca\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\webapps\ServletTest\newsPub

request.getRealPath("/") =

D:\zfsca\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\webapps\ServletTest\

你可能感兴趣的:(php中getUri())