JSTL無法使用的問題
報錯:The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar
導入JSTL
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
在maven的pom.xml配置
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
問題仍未解決,參考博客
最終查到問題是 jstl.jar 包在ide項目中有,但在tomcat發佈的應用WEB-INF/lib下沒有,這是工具發佈項目的問題,複製一個jar包過去問題就解決了。
jstl.jar沒有
<%Java%>代碼無法識別等問題
發現沒有 pom.xml 引入 servlet 的包
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>