首页 > 其他 > 详细

servlet的请求路径区分

时间:2017-12-16 16:51:08      阅读:197      评论:0      收藏:0      [点我收藏+]

System.out.println("contextPath:"+req.getContextPath());
System.out.println("servletPath:"+req.getServletPath());
System.out.println("requestURI:"+req.getRequestURI());
System.out.println("requestURL:"+req.getRequestURL());

输出结果如下:

contextPath:/test
servletPath:/findEmp
requestURI:/test/findEmp
requestURL:http://localhost:8080/test/findEmp

servlet的请求路径区分

原文:http://www.cnblogs.com/boling1/p/8046871.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!