日期:2014-05-16  浏览次数:20372 次

struts提示异常:javax.servlet.jsp.JspException: Cannot find message
点击右边红色标题查看本文完整版:struts提示异常:javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE

Tomcat 4.0.3版本。
?
? 每次运行,在控制台窗口都会提示:
? log4j:WARN No appenders could be found for logger (org.apache.struts.util.Proper tyMessageResources).
? log4j:WARN Please initialize the log4j system properly.
?
? 我想这应该不会影响Struts,可能是struts中需要使用log4j,但在log4j.properties中没有设置。
?
? 关键是JSP页面出错:
? javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
? at org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1103)
? at org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
? at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
? at org.apache.jsp.index$jsp._jspService(index$jsp.java:89)
? ......
?
? 我在struts-config.xml中定义了
? <message-resources parameter="ApplicationResources" null="false" />
? 是否与此相关?
?
? ApplicationResources.properties 文件应该放在哪个目录下面? 是否在中文系统应该改为 ApplicationResources_zh.propertise?
?
? 请指教。

------解决方法--------------------
放在\WEB-INF\classes里面。ApplicationResources_zh.propertise这个无所谓,只是支持中文字符而已。
------解决方法--------------------
ApplicationResources.properties class下