天天看点

使用jstl报http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar错误

今天创建了一个maven项目,想使用jstl报http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar的错误

该加的我都加了:

1、pom.xml

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

jstl1.2只需要添加这一个包的支持就可以

2、页面上引用jstl要这么写:

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

这个头跟jstl1.0的写法是不一样的,看我标红的部分。

可就是一打开就报错!!!网上查了半天,没有一个能解决我的问题,汗~~~

折腾了半天,在tomcat安装目录的lib文件夹下也放了一份jstl-1.2.jar,终于不再报错了!

继续阅读