String scheme = request.getScheme(); //获取协议(http)
String serverName = request.getServerName(); //获取服务器名(localhost)
int port = request.getServerPort(); //获取端口号(8080)
String contextPath = request.getContextPath(); //获取项目(/srm-web)
String servletPath = request.getServletPath(); //获取Servlet请求路径(/sy/security/login.do)
String urlPath = request.getRequestURL().toString(); //获取不含参数的浏览器url(http://localhost:8080/zcj-web/sy/security/login.do)
String uriPath = request.getRequestURI(); //获取不含参数的浏览器url的部分值(/zcj-web/sy/security/login.do)
HttpServletRequest请求信息
最新推荐文章于 2022-05-03 17:59:56 发布