我已将标签库包含为 -
<%@ taglib prefix="wf" uri="http://www.wrox.com/begjsp/el-functions-taglib" %>
web.xml 是
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd"
version="3.0">
// some description and name
<taglib>
<taglib-uri>
http://www.wrox.com/begjsp/el-functions-taglib
</taglib-uri>
<taglib-location>
/WEB-INF/jsp/function-taglib.tld
</taglib-location>
</taglib>
但是,部署此应用程序会出现以下错误日志(catalina.out)
INFO: Deploying web application archive /home/eanautg/2bkp/jsp/apache-tomcat-7.0.42/webapps/ch05.war
Sep 8, 2013 5:57:39 PM org.apache.tomcat.util.digester.Digester startElement SEVERE: Begin event threw exception
java.lang.IllegalArgumentException: taglib definition not consistent with specification version at org.apache.catalina.startup.TaglibLocationRule.begin(WebRuleSet.java:1274) at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504) ...
Sep 8, 2013 5:57:39 PM org.apache.catalina.startup.ContextConfig parseWebXml SEVERE: Occurred at line 13 column 16 Sep 8, 2013 5:57:39 PM org.apache.catalina.startup.ContextConfig configureStart SEVERE: Marking this application unavailable due to previous error(s)
我尝试将架构和版本号更改为 3.0 但徒劳 -
schema = "...web-app_3_0.xsd"
version="3.0">`
我在另一个线程中读到 taglib 不应在 web.xml 中定义。那么根据新规范它应该在哪里?我错过了什么吗?请告诉我。 谢谢, 史黛西。
最佳答案
不确定这是否有帮助,但我在尝试查找黑板插件问题时遇到了这篇有关 Tomcat 7 taglib 声明的文章。
在 Tomcat 7 中,您的 web.xml 文件中的标记库应包含在 < jsp-config > 元素中。
关于apache - tomcat 7 taglib规范版本不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18683784/