你没有配置好message resources,你如果用到bean:message标记,html:errors……等标都会用到message resources,它们默认resources就是org.apache.struts.action.MESSAGE,还有validator也会用到这个resources,因引你应该在struts-config.xml文件里指定一个message resources但不要指定key属性,因为默认就是org.apache.struts.action.MESSAGE,如:
<message-resources parameter="com.iconsh.demo.resources.DemoResources"/>
<message-resources parameter="com.iconsh.demo.resources.DemoResources"/>
<init-param>
<param-name>application</param-name>
<param-value>strutsdemo.ApplicationResource</param-value>
</init-param>
如果是struts1.1查看
<message-resources parameter="strutsdemo.ApplicationResources"/>
这一项。看看message-resources文件是否存在,配置是否正确。
把你的资源文件例如
ApplicationResources_zh_CN.properties
注意这个"ApplicationResources"是你在web.xml的
<init-param>
<param-name>application</param-name>
<param-value>package.ApplicationResources</param-value>
</init-param>
配的.注意package是你包名(最好和action类放在一起).