request请求地址

1、String contextPath = httpServletRequest.getServletContext().getContextPath();

/项目名称

2、String contextPath2 = httpServletRequest.getContextPath();

/项目名称

3、String requestURI = httpServletRequest.getRequestURI();

/项目名称/自定义.jsp

4、StringBuffer requestURL = httpServletRequest.getRequestURL();

http://localhost:8089/项目名称/自定义.jsp

5、String servletPath = httpServletRequest.getServletPath();

/自定义.jsp

posted @ 2017-01-18 16:55  程序猿001  阅读(594)  评论(0编辑  收藏  举报