Java之关于JSTL引入问题

错误信息:Can not find the tag library descriptor for “http://java.sun.com/jstl/core”
JSTL taglib需要jstl.jar来支持。在1.0和1.1版本的时候,还需要standard.jar来配合。
但从1.2版本开始,jar文件名字变成了jstl-1.2.jar,也不再需要standard.jar了。
另外,servlet 版本需要2.4以上。所以正确的做法是把jstl-1.2.jar放到WEB-INF/lib里面就可以了。或者通过maven来配置,

    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>



    jstl版本低于1.2记得在maven依赖配置这个 不过一般情况都会使用高版本的jst

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


 
  在用到jstl的页面上增加下面一段话。

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

猜你喜欢

转载自www.cnblogs.com/youcong/p/9858222.html