静态资源404:pageContext.request.contextPath地址无法解析
原因分析:
发生这种问题的原因一般为EL表达式无法识别;
一般是jsp页面没有支持EL表达式。(个别版本默认关闭EL表达式)
解决方案:
- 在jsp页面设置支持EL表达式
- 更改web.xml中的头信息,选择默认支持EL表达式的版本
源代码:
<?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">
注意:设置完成后,重新部署项目生效。