• 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>

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

  • 相关阅读:
    树莓派远程连接工具VNC使用教程
    winform开发之UI系列
    设计winform自带动态加载工具按钮和实现热键响应
    winform版弹框操作
    vs2012中将图片放到resource中进行调用
    构建winform控件数据缓存器
    c#跨线程访问控件帮助类
    CSS3过渡
    JavaScript 内置对象 Array 数组
    JavaScript 数组sort方法使用
  • 原文地址:https://www.cnblogs.com/xusweeter/p/7151032.html
Copyright © 2020-2023  润新知