zoukankan      html  css  js  c++  java
  • Tomcat6和7版本对web.xml中taglib标签的配置差异

    原来部署在Tomcat6中的应用在Tomcat7中运行时报错如下错误:

    java.lang.IllegalArgumentException: taglib definition not consistent with specification version
    
    严重: Parse error in application web.xml file at jndi:/localhost/iot/WEB-INF/web.xml
    org.xml.sax.SAXParseException; systemId: jndi:/localhost/iot/WEB-INF/web.xml; lineNumber: 217; columnNumber: 10; Error at (217, 10) : taglib definition not consistent with specification version

    经百度发现,Tomcat7中对Web应用web.xml中的taglib标签配置稍有不同,需要在taglib标签外添加“jsp-config”标签进行包裹才行。

    TomcatV6中的配置:

    <taglib>
        <taglib-uri>sys</taglib-uri>
        <taglib-location>/WEB-INF/SysTag.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>tiles</taglib-uri>
        <taglib-location>/WEB-INF/tiles-jsp.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>struts-tags</taglib-uri>
        <taglib-location>/WEB-INF/struts-tags.tld</taglib-location>
    </taglib>

    TomcatV7中的配置:

    <jsp-config>
        <taglib>
            <taglib-uri>sys</taglib-uri>
            <taglib-location>/WEB-INF/SysTag.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>tiles</taglib-uri>
            <taglib-location>/WEB-INF/tiles-jsp.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>struts-tags</taglib-uri>
            <taglib-location>/WEB-INF/struts-tags.tld</taglib-location>
        </taglib>
    </jsp-config>

    更新配置后即可正常启动。

  • 相关阅读:
    工作中碰到的小问题记录
    MySQL之路 ——1、安装跳坑
    C# 构造函数
    C# 操作文件类,文件夹存在判断,创建,文件内容读写。
    你为什么(不)用存储过程?
    C#基础巩固之基础类型
    mysql存储过程中使用事务
    Redis 安装
    Maven 国内映像
    mysql存储过程详解
  • 原文地址:https://www.cnblogs.com/xusweeter/p/7151032.html
Copyright © 2011-2022 走看看