最近项目从tomcat6升级到tomcat7.0.42后,有个jsp页面带有struts1标签总是报错。
提示信息如下:At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
按照网络上的办法:
①去掉<!-- -->注释后页面还是报错;
②在catalina.properties中添加org.apache.el.parser.SKIP_IDENTIFIER_CHECK=true,也还是报错!
肿么办?
后来是在不行,把页面一部分一部分截取,然后定位错误代码,终于找到了:
在tomcat6中,<bean:write name="deviceEventForm" name="msg"/> 这样可以取到值;
但是在tomcat7中,<bean:write name="deviceEventForm" name="msg"/>这样是错的,必须改成<bean:write name="deviceEventForm" property="msg"/>;
网上很多童鞋说tomcat7对标签的使用检查更加严格,先不论其准确性,但是以后写代码一定要规范!