1、访问静态变量图片
<!-- 静态资源访问 -->
<mvc:resources location="/WEB-INF/images/" mapping="/images/**"/>
<mvc:annotation-driven />
2、路径
String p1 = request.getContextPath(); //项目名称 /Project
String p2 = request.getRealPath("../"); //绝对地址/home/zq/local/tomcat/apach../webapps/Project
String p3 = request.getServletPath(); // /hello servlet映射的函数路径
String p4 = request.getRequestURL().toString(); //http://localhost:8080/Project/hello