[踩坑记录] 使用maven默认创建的webapp项目,引起的找不到资源问题

maven默认webapp的webapp是2.3版本,在解析\({pageContext.request.contextPath}时会被被解析成\)%7BpageContext.request.contextPath%7D,从而使项目找不到资源
解决方案:休息web.xml版本中的信息即可
如:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
</web-app>
posted @ 2020-11-28 12:09  blanktao  阅读(104)  评论(1)    收藏  举报