getContextpath、getServletPath、getRealpath的不同

来源:互联网 发布:财务报表数据下载 编辑:程序博客网 时间:2024/06/08 15:34

请求url:localhost:8080/myInterceptor/user/login.jsp

1、 System.out.println(request.getContextPath());
打印结果:/myIntercetor
 2、System.out.println(request.getServletPath());
打印结果:/user/newForm.jsp
 3、 System.out.println(request.getRequestURI());
打印结果:/MyInterceptor/user/newForm.jsp

阅读全文
0 0