当前位置: 代码迷 >> Web前端 >> HttpServletRequest.getRequestURI() 跟HttpServletRequest.getRequestURL()区别是什么?(转)
  详细解决方案

HttpServletRequest.getRequestURI() 跟HttpServletRequest.getRequestURL()区别是什么?(转)

热度:644   发布时间:2012-11-03 10:57:44.0
HttpServletRequest.getRequestURI() 和HttpServletRequest.getRequestURL()区别是什么?(转)
request.getRequestURI() 返回值类似:/xuejava/requestdemo.jsp
  
request.getRequestURL() 返回值类似:http://localhost:8080/xuejava/requestdemo.jsp

附:
request.getContextPath() = /hboys
request.getLocalAddr() = 127.0.0.1
request.getPathInfo() = null
request.getPathTranslated() = null
request.getRemoteAddr() = 127.0.0.1
request.getRequestURI() = /hboys/
request.getScheme() = http
request.getServerName() = 127.0.0.1
request.getServletPath() = /index.jsp
request.getClass() = class org.apache.catalina.connector.RequestFacade
request.getHeaderNames() = org.apache.tomcat.util.http.NamesEnumerator@1ad0839
request.getLocale() = zh_CN
request.getLocales() = org.apache.catalina.util.Enumerator@f6f1b6
request.getParameterMap() = {}
request.getRequestURL() = http://127.0.0.1:8081/hboys/
request.getUserPrincipal() = null
request.getParameterNames() = java.util.Hashtable$EmptyEnumerator@1629e71
request.getRealPath("newsPub") = D:\workspace\hboys\WebRoot\newsPub
  相关解决方案