问题
${pageContext.request.contextPath}获取绝对路径乱码问题,导致jsp页面获取不到静态资源
解决方法
IDEA创建项目时web.xml中的头文件默认版本是2.3,需要改成3.1,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">