码迷,mamicode.com
首页 > 移动开发 > 详细

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问题解决方案参考

时间:2019-03-27 17:08:47      阅读:723      评论:0      收藏:0      [点我收藏+]

标签:The   res   编译   stand   java   网上   自己   jar   pre   

错误信息: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

分几种情况:

1.jstl.jar是1.1版本,需要引入standard.jar。

2.上述两个jar包如果都有了,反编译standard.jar包查看是否c.tld中的<uri>http://java.sun.com/jsp/jstl/core</uri>是不是和你页面上引用的taglib的uri一致。

  jstl1.0是http://java.sun.com/jstl/core

  jstl1.1是http://java.sun.com/jsp/jstl/core

  两者相差个/jsp

3.如果jstl是1.2版本,那么这个jar包中集成了standard,不需要再引入standard.jar。

4.可能跟tomcat版本有关系。

  Tomcat6 实现了 servlet 2.5 和JSP2.1的规范,可以支持JSTL1.2;

  Tomcat5实现了 servlet 2.4 和JSP2.0的规范,只能支持JSTL1.1;

5.如果是使用tomcat7及以上版本出现问题。网上搜索有人说是tomcat7+版本不再支持jstl标签库自动导入,需要自己手动添加。

web.xml配置中需要如下配置,并且将jstl1.2.jar中的c.tld(或如果使用jstl1.1版本,将standard.jar中的c.tld)拷出一份来放到WEB-INF路径下。

  <jsp-config>
      <taglib>
          <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
          <taglib-location>/WEB-INF/c.tld</taglib-location>
      </taglib>
  </jsp-config>

本人测试tomcat6的web.xml不用配置也未出现上述的错误信息。不过也能加上配置,去掉jsp-conifg标签即可。

      <taglib>
          <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
          <taglib-location>/WEB-INF/c.tld</taglib-location>
      </taglib>

希望可以帮到大家~

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问题解决方案参考

标签:The   res   编译   stand   java   网上   自己   jar   pre   

原文地址:https://www.cnblogs.com/jinzhiming/p/10608618.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!