java 有 类似Request.ServerVariables("HTTP_REFERER") 获取上个页面的方法吗?
java有类似Request.ServerVariables("HTTP_REFERER")获取上个页面的方法吗?...
java 有 类似Request.ServerVariables("HTTP_REFERER") 获取上个页面的方法吗?
展开
1个回答
展开全部
用request.getRequestURL();
---------------------------
HttpServletRequest request
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
---------------------------
HttpServletRequest request
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
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询