- - PR -
struts1.1でbean:messageタグを使用する際の設定について
1
| 投稿者 | 投稿内容 |
|---|---|
|
投稿日時: 2004-05-19 12:15
bean:messageタグを使用した際、
以下のようなエラーが発生します。 javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.test_jsp._jspService(test_jsp.java:67) −以下略− 対処方法をご存知の方がいらっしゃいましたら、 ご教授ください。 なお、JSPファイル及び設定ファイルの内容は以下の通りです。 ---jspファイルの内容--- <%@ page contentType="text/html;charset=Shift_JIS" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <html:html> <head> <title>TEST</title> <html:base/> </head> <body> <bean:message key="title.head" bundle="org.apache.struts.action.MESSAGE"/> </body> </html:html> --- リソースファイルの配置場所 --- WEB-INF/classes/jp/co/test/ApplicationResources.properties WEB-INF/classes/jp/co/test/ApplicationResources_ja.properties --- struts-config.xml --- ※struts-blank.war内のstruts-config.xmlに以下を追加。 <message-resources parameter="jp.co.test.ApplicationResources" key="org.apache.struts.action.MESSAGE"> </message-resources> --- web.xml --- ※struts-blank.war内のweb.xmlに以下を追加。 <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> --- 開発環境 --- Windows XP Home Edition Tomcat 4.1.30 j2sdk1.4.2_04 struts1.1 どうぞよろしくお願いいたします。 [ メッセージ編集済み 編集者: ぴょんぴょん 編集日時 2004-05-19 12:37 ] |
|
投稿日時: 2004-05-19 16:15
ぱっと見これと同じ現象のようです。参考になるでしょうか?
http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=7425&forum=12&11 |
|
投稿日時: 2004-05-19 19:03
インギさん、ご回答をいただきありがとうございました。
リンク先のページを拝見しました。 インギさんに教えていただいた事例と、 私の開発環境上で発生した現象で、 少し異なる点があります。 前者では、struts-config.xml内のmessage-resourcesタグで propertiesファイルの配置場所を指定することにより 解決しているのですが、 (<message-resources parameter="resources.application"/>) 私の場合同様にstruts-config.xml内で 以下のように指定した場合にも、 エラーが発生してしまいます。 <message-resources parameter="jp.co.test.ApplicationResources" key="org.apache.struts.action.MESSAGE"> </message-resources> |
1
