1. 問題描述
從tomcat 6 遷移到tomcat 7 時,運行web項目時出現"taglib definition not consistent with specification version"從上面可以看出, 這是taglib的定義不符合規範版本的原因引起來的
下圖可看出錯誤的地方:
2. 解決方法
修改web.xml, 如下:
修改前:
<taglib>
<taglib-uri>/custom</taglib-uri>
<taglib-location>/WEB-INF/tld/custom.tld</taglib-location>
</taglib>
修改後:
<!-- 自定義標籤 -->
<jsp-config>
<taglib>
<taglib-uri>/custom</taglib-uri>
<taglib-location>/WEB-INF/tld/custom.tld</taglib-location>
</taglib>
</jsp-config>