java - TldLocations 缓存 : null - Importing taglib on tomcat6

标签 java tomcat tags tomcat6 taglib

我收到臭名昭著的 TldLocationsCache: null。 :-(

我的 taglib 在我的 jar 的 META-INF 里面。所以在我的 web.xml 中我这样做:

<jsp-config> 
   <taglib> 
      <taglib-uri>myTags</taglib-uri> 
      <taglib-location>/WEB-INF/lib/myTagLib-2.0.0.jar</taglib-location> 
   </taglib> 
</jsp-config> 

在我的 JSP 上:

<%@ taglib uri="myTags" prefix="m" %>

但后来我得到:

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: null
    org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:248)
    org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:219)
    org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:553)

我正在运行 Tomcat6。任何帮助将不胜感激。谢谢!

最佳答案

<taglib-location>应引用.tld , 所以改变

<taglib-location>/WEB-INF/lib/myTagLib-2.0.0.jar</taglib-location>

<taglib-location>/WEB-INF/lib/myTagLib-2.0.0.tld</taglib-location>

或与 tld 的路径类似的东西文件。

这也很有用:Removing <taglib> from web.xml

关于java - TldLocations 缓存 : null - Importing taglib on tomcat6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7827398/

相关文章:

apache - Tomcat 连接池耗尽

angular - Spring Boot嵌入式Tomcat可以访问定义的spring.tomcat.basedir的webapps文件夹吗

java - h :panelGrid 中具有多个子组件的自定义 Facelets 标记

javascript - 使用 jQuery 创建新元素的正确或更好方法是什么?

javascript - IE10 视频标签突然停止工作

java - 使用 JSoup 在 Java 中修改 html 标签自己的文本

java - 本地运行的 Hive 包含 LZO 的 native 库

java - 从 Java 接口(interface)实现泛型方法

java - Selenium 找不到定位器

java - tomcat中的 session 迁移/复制