如下图所示:
<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <scope>provided</scope> <version>2.0</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.25</version> </dependency> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> </dependencies>
增加相干依靠后,若照样涌现上面没法一般显现的状况,能够尝试一下的解决要领:
我以为这不是JSTL的题目,${emp.role}是EL(表达言语),它不起作用。
我们能够在JSP文件设置
<%@ page isELIgnored="false" %>
或许在web.xml设置
<el-ignored>true</el-ignored>
它应该是false默许,但假如你运用的servlet版本低于2.4,则默以为true,所以在这类状况下,你须要将其设置为false在web.xml:
<jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <el-ignored>true</el-ignored> </jsp-property-group> </jsp-config>
您有3.1依靠项版本,但运用的是web.xml文件2.3版本。要运用Servlet 3.1尝试将您变动web.xml为:
<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"> rest of the TAGs </web-app>
修正终了后的结果:
以上就是el表达式与jstl标签不能用解决要领的细致内容,更多请关注ki4网别的相干文章!