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>

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

  • 相关阅读:
    理解RESTful架构
    Javascript闭包
    Javascript立即执行函数
    多个Jboss端口冲突配置;一个Jboss多个server端口配置
    MyEclipse部署Jboss出现java.lang.OutOfMemoryError: PermGen space
    css摘抄
    css 浮动和绝对定位的区别
    搭建第一个web项目:jasperReports+ireport制作pdf报表
    Hibernate的检索方式
    浅谈JavaScript的作用域
  • 原文地址:https://www.cnblogs.com/xusweeter/p/7151032.html
Copyright © 2011-2022 走看看