godwithus

问题描述:

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包,否则你会看到:

 像这样就对了

分类:

技术点:

相关文章:

  • 2021-09-06
  • 2021-11-11
  • 2021-11-05
  • 2020-07-14
  • 2021-03-02
  • 2021-11-05
  • 2021-09-10
猜你喜欢
  • 2022-01-01
  • 2021-06-16
  • 2021-07-18
  • 2021-10-08
  • 2021-11-15
  • 2021-09-10
  • 2022-01-03
相关资源
相似解决方案