本文主要是介绍request.getRequestURI() request.getRequestURL(),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
HttpServletRequest.getRequestURI()和HttpServletRequest.getRequestURL()区别是什么?
分类: JAVA类 2008-11-19 15:23 1348人阅读 评论(0) 收藏 举报
class
在网上搜集到的,顺便整理到空间中。与狼共享!!!!!!!!
request.getRequestURI() 返回值类似:/xuejava/requestdemo.jsp request.getRequestURL() 返回值类似: http://localhost:8080/xuejava/requestdemo.jsp 附: request.getContextPath() = /hboysrequest.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 |
这篇关于request.getRequestURI() request.getRequestURL()的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!