jsp不解析el表达式,不识别jstl标签,找不到http://java.sun.com/jsp/jstl/core

问题描述:

jsp页面中el表达式,例如:${pageContext.request.contextPath},原样呈现,未被解析。

解决方案:

为jsp页添加page指令如下: 

<%@ page isELIgnored="false" %>

jsp页面无法识别jstl标签

jsp页加入taglib指令

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

但找不到这个标签库

导入jar包:

jstl.jar

standard.jar

maven pom:

        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

注意其版本,建议1.1.2版

现最新版为jstl-1.2,用它可以省掉standard.jar包,但不好用,配合tomcat7使用也要做些调整。

注意:

1.1版对应的uri="http://java.sun.com/jsp/jstl/core"

1.0版对应的uri="http://java.sun.com/jstl/core"

确保WEB-INF/lib文件夹中有这两个jar包,否则你会看到:

 像这样就对了

原文地址:https://www.cnblogs.com/godwithus/p/8771105.html