1. 问题描述
项目由tomcat6升级为7后,启动tomcat时出现"taglib definition not consistent with specification version"
从上面可以看出, 这是taglib的定义不符合规范版本的原因引起来的
2. 解决方法
修改web.xml, 如下
修改前:
<taglib> <taglib-uri>struts-html</taglib-uri> <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>struts-bean</taglib-uri> <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>struts-logic</taglib-uri> <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location> </taglib>
修改后:
<jsp-config> <taglib> <taglib-uri>struts-html</taglib-uri> <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>struts-bean</taglib-uri> <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>struts-logic</taglib-uri> <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location> </taglib> </jsp-config>
即将涉及标签库那部分代码放在<jsp-config>标签内即可。 转载地址:http://blog.csdn.net/cryhelyxx/article/details/40711695