1. 程式人生 > >使用jstl報http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar錯誤

使用jstl報http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar錯誤

spa tag 有一個 lib 寫法 支持 這一 maven web

今天創建了一個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,終於不再報錯了!

使用jstl報http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar錯誤