apache - tomcat 7 taglib规范版本不一致

标签 apache jsp tomcat

我已将标签库包含为 -

<%@ 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 声明的文章。

http://help.blackboard.com/en-us/Learn/9.1_SP_14/Administrator/010_Release_Notes/025_SP14_Release_Notes/Performance_and_Scalability/Tomcat_7

在 Tomcat 7 中,您的 web.xml 文件中的标记库应包含在 < jsp-config > 元素中。

关于apache - tomcat 7 taglib规范版本不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18683784/

相关文章:

java - Servlet 过滤器 url-mapping/* 不适用于 404 错误

php - 使用 PHP 将用户名放入 apache access_log 且不使用 HTTP 身份验证

mysql连接无法使用tomcat进行JSP部署

java - restFB post as page step by step 工作示例

apache - Tomcat 7 WAR部署LifecycleException

mysql - 无法在 Windows 7 上获得到 MySql 的多个连接

java - OSGI 传递依赖级别

MySQL 端口还是套接字?

jsp - 在tomcat文件夹外显示图片

java - 是否可以在服务器上配置 c3p0 而不是 WAR 文件?