HttpServletRequest地址获取

 

HttpServletRequest request = (HttpServletRequest) servletRequest;
System.out.println("--------------------begin------------------------");
System.out.println("request.getContextPath():"+ request.getContextPath());
System.out.println("request.getRequestURI():" + request.getRequestURI());
System.out.println("request.getLocalName():" + request.getLocalName());
System.out.println("request.getLocalAddr():" + request.getLocalAddr());
System.out.println("request.getServletPath():" + request.getServletPath());
System.out.println("request.getRequestURL():" + request.getRequestURL());
System.out.println("request.getServerName():" + request.getServerName());
System.out.println("request.getRemoteAddr():" + request.getRemoteAddr());
System.out.println("request.getPathInfo():" + request.getPathInfo());
System.out.println("------------------end--------------------------");
 

HttpServletRequest地址获取_第1张图片

你可能感兴趣的:(HttpServletRequest地址获取)