JSP EL表达式失效
如果你的EL表达式失效时有两个方法:
方法一:
在每个jsp头加一句
<%@ page isELIgnored="false" %>
方法二:
在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_3_1.xsd"
version="3.1">
<jsp-config>
<jsp-property-group>
<description>JSPConfig</description>
<display-name>jspConfig</display-name>
<!-- jsp目录下所有 -->
<url-pattern>/jsp/*</url-pattern>
<!-- el表达式生效,false生效,true失效 -->
<el-ignored>false</el-ignored>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>
</web-app>