关于JSP中org.apache.jasper.JasperException:
This absolute uri http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
照着《精通JSP--Web开发技术与典型应用》敲了一段JSTL的代码。没想到报错了。为这个问题搞了一下午,坐得屁股疼……
我的开发环境是Eclipse 3.2.0、Myeclipse 5.0、Tomcat 5.0.28(它用的是JRE1.4)和JDK1.5
从网上搜了一下,相同的说法是:一个就是JSTL的版本问题(1.0与1.1),是否不一致。还有就是检查虚拟目录下WEB-INF目录下的lib文件夹(如果同有lib文件夹,后动创建一个)中是否有jstl.jar和standard.jar两个jar包,如果没有则把它们复制到lib下面。
都试了,不过报错依旧……后来又找了一下加上自己的乱搞,按照上面的改过之后,大体有两种解决方法:
第一种就是在Eclipse的工程中导入JSTL1.1后,下载JSTL1.1 http://jakarta.apache.org/taglibs/index.html
然后解压,把*.jar和*.tld放到/WEB-INF/lib目录下。也就是将所有的jakarta-taglibs-standard-current.zip(JSTL的类库)中的.jar和.tlb放到WEB-INF目录下的lib文件夹中,JSP文件中导入<%@ taglib prefix="c" uri="/WEB-INF/lib/c.tld" %>,经试验是可以的。
第二种是修改web.xml,加上下面的语句:
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
</jsp-config>
JSP中导入<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>。应该就可以了……
推荐第二种^_^!
分享到:
相关推荐
HTTP Status 500 - 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
@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core” %> 2.如果jsp页面报如下异常 org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.Customer.addCustomerInfo_...
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or t 最终查到问题是 jstl.jar 包在ide项目中有,但在tomcat发布的应用WEB-INF/lib下没有,这是工具发布项目的问题,...
当出现类似 `org.apache.jasper.JasperException: 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` 的异常时,这通常...
jetty的main启动代码及相关jar包: ...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 导入jsp-api.jar就可以解决。
**The absolute uri:http://java.sun.com/jsp/jstl/core(也可能是http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed** 可能二:项目目录下WEB-INF/lib下没有jstl.jar...
解决struts2中报错:“HTTP Status 500 - org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this ...
关于The absolute uri: http://java.sun.com/jstl/core_rt cannot be resolved in either web.xml or the jar files deployed with this application解决! 将jstl.jar和standard.jar包导入工程后,运行页面依然...
这个是一个jar包,适用于...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,遇到这种报错信息,多半是缺少jar包。
当遇到类似`org.apache.jasper.JasperException: 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`这样的异常时,...
当你在JSP页面中使用JSTL标签,如`<c:out>`,但出现"The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved"错误时,这通常是因为缺少JSTL库。你需要确保在项目的类路径下包含了JSTL的jar文件,...
在尝试访问`WEB-INF/jsp`页面时,可能会遇到如下的错误提示:“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”。...