若web application 名称为myweb,你在浏览器中输入请求路径: http://localhost:8090/myweb/main/welcome.jsp
input output 关系如下:
1、 System.out.println(request.getContextPath());
result:/myweb
2、System.out.println(request.getServletPath());
result:/main/welcome.jsp
3、 System.out.println(request.getRequestURI());
result:/myweb/main/welcome.jsp