【问题】 http://java.sun.com/jsp/jstl/core cannot be resolved

错误:[b]org.apache.jasper.JasperException: /WEB-INF/views/index/index.jsp(6,0) The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application[/b]

框架:springMVC 3.2.3
tomcat:6.X

---------------------------
看错误,index.jsp第6行:<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core " %>
标签库有问题啊。。。

但是奇怪的是,我在7.X下运行,完全没有任何问题。

后来去网上查了下,说jstl标签需要两个包:jstl.jar和standard.jar。

一看项目的lib,只有jstl.jar包,而standard.jar包却没有。。

[b]所以在项目中加上standard.jar,问题解决。[/b]


(至于7.X下为什么可以就不清楚了,看了下tomcat的lib下,也没有这个包。)

--------------------------

查看了下tomcat 6.X的servlet版本,是2.5,jstl.jar版本是1.1,网上前辈说jstl.jar1.2以上可以不用standard.jar。

tomcat 7.X的servlet版本是3.0,不知道3.0版本是否对jstl进行扩展以便更好的支持标签库的原因,才导致7.X下不需要standard.jar。

具体的servlet,jsp,jstl的版本配置如下图:
[img]http://dl.iteye.com/upload/picture/pic/128359/3e07dd98-3fa0-3f36-82d3-9e37504e70a8.jpg[/img]

---------------------------
[b]如何查看版本:将jar文件右键,用360压缩,或是WinRar打开,里面有个META-INF文件夹,打开它,找到MANIFEST.MF.[/b]

如下:
Manifest-Version: 1.0
Specification-Title: JavaServer Pages Standard Tag Library (JSTL)
Created-By: 1.4.2-38 ("Apple Computer, Inc.")
Ant-Version: Apache Ant 1.6.1
Implementation-Title: JavaServer Pages Standard Tag Library API Refere
nce Implementation
Specification-Version: 1.1
Implementation-Vendor-Id: com.sun
Extension-Name: javax.servlet.jsp.jstl
Implementation-Version: 1.1.2
Implementation-Vendor: Sun Microsystems, Inc.

就能找到相应的版本号了。

---------------------------
参考网址:
How to Reference and Use JSTL in your Web Application
[url]http://www.mularien.com/blog/2008/04/24/how-to-reference-and-use-jstl-in-your-web-application/[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值