使用Jstl異常:The absolute uri: http://java.sun.com/jsp/jstl/core cannot&nbs
錯誤提示是:
org.apache.jasper.JasperException: This absoluteuri http://Java.sun.com/jsp/jstl/core) cannot be resolved in eitherweb.xml or the jar files deployed with thisapplication
web項目出現如上問題,據查是版本問題:
JSTL 1.0的聲明是:
<%@ taglib prefix=”c”uri=”http://java.sun.com/jstl/core ” %>
JSTL1.1以後的聲明是:
<%@ taglib prefix=”c”uri=http://java.sun.com/jsp/jstl/core%>
項目中,已經是 jstl 1.2 版本了,頁面中也全部是用<%@ taglib prefix=”c”uri=http://java.sun.com/jsp/jstl/core%>這種方式。javaee5之後就只有 jstl.jar這一個jar包了,沒有standard.jar包,tld文件也打包到jstl.jar裏面去了,網上有一種說法是在web.xml文件裏配置jsp-config的解決方式是沒有用的
解決辦法:
下載一個jstl1.2的jar包,就是javax.servlet.jsp.jstl-1.2.1,複製到web-inf的lib文件夾下,點擊右鍵build path->add 添加支持,這樣問題就解決了。