Cannot find message resources under key org.apache.struts.action.MESSAGE

[size=medium][color=red][b]异常1:[/b][/color][/size]
Cannot find message resources under key org.apache.struts.action.MESSAGE


bug原因:没有在struts.xml配置ApplicationResources:
解决办法:
步骤1.struts-config-core.xml配置:

<message-resources parameter="properties.ApplicationResources_cn" />
<message-resources key="chinese" parameter="properties.ApplicationResources_cn" />
<message-resources key="english" parameter="properties.ApplicationResources" />
<message-resources key="cn" parameter="properties.ApplicationResources_cn" />
<message-resources key="en" parameter="properties.ApplicationResources" />

步骤2.在下面系统文件夹加入properties文件
src/platform/Resource
|_propertirs
|_ApplicationResources_cn.properties
|_ApplicationResources.properties


[size=medium][color=red][b]异常2:异常1解决以后,重启报异常[/b][/color][/size]
org.xml.sax.SAXParseException: The content of element type "struts-config" must match "(display-name?,description?,data-sources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)"



解决办法:
参考1:[url]http://bigdragon.iteye.com/blog/1465018[/url]
参考2:[url]http://blog.csdn.net/yunxihanherui/article/details/7486132[/url]
在web.xml启动struts1的地方加入:

<!-- struts1配置文件 -->
<servlet>
<servlet-name>struts1</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/classes/struts/core/struts-config-core.xml,
/WEB-INF/classes/struts/example/struts-config-example.xml,
/WEB-INF/classes/struts/tools/struts-config-document.xml
</param-value>
</init-param>
<init-param> 加入段代码就OK了!
<param-name>validating</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>



参考资料:[url]http://www.cnblogs.com/tjsquall/archive/2008/11/27/1342258.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值