jsp頁面忽視了el標簽,要加入<%@ page isELIgnored="false" %>,這只是妥協方案
注:EL表達式不需要引入包,tomcat自帶,與servlet的包有關
解決根本方法:
1.如果JSP中無法自動提示EL表達式的解決方法,在maven的pom.xml中加入如下代碼

1 <dependency> 2 3 <groupId>javax.servlet</groupId> 4 5 <artifactId>jsp-api</artifactId> 6 7 <version>2.0</version> 8 9 <scope>provided</scope> 10 11 </dependency>
2.如果JSP中EL表達式不起作用,原樣輸出,可以更改web.xml的web-app標簽中的命名空間來解決

1 <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" 2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 4 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" 5 version="3.1"> 6 </web-app>
3.web.xml中配置

1 <jsp-config> 2 <jsp-property-group> 3 <url-pattern>/jsp/* </url-pattern> 4 <el-ignored>true</el-ignored> 5 </jsp-property-group> 6 </jsp-config>