我收到臭名昭著的 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
的路径类似的东西文件。
关于java - TldLocations 缓存 : null - Importing taglib on tomcat6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7827398/