You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Simon Liang <Sl...@verticalnet.com> on 2001/06/20 20:31:36 UTC

MessageBundle

Hi all:

For some reason, Strut can't find my message bundle. For testing purpose, i
have 2 language(thus 2 properties files).
MyResources.properties(default for English)
MyResources_fr.properties(for French)

On the JSP message bean call, the default English works fine. But i can't
get the French version to work. It tells me:
javax.servlet.jsp.JspException: Cannot find message resources under key
MyResources

<!-- jsp code -->
<h3><bean:message bundle="MyResouces" locale="fr" key="um_user.heading"/>
    <%= userSession.getName()%>
</h3>
<!-- end jsp code -->

<!-- the xml config file here -->
<servlet>
	<servlet-name>action</servlet-name>
	
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
	<init-param>
		<param-name>application</param-name>
		<param-value>MyResources</param-value>
	</init-param>
	...
</servlet>

Am i doing something wrong? Please help!

Simon
		


============================================================================
This message is intended only for the use of the Addressee(s) and may
contain information that is PRIVILEGED and CONFIDENTIAL. If you are not
the intended recipient, dissemination of this communication is prohibited.
If you have received this communication in error, please erase all copies
of the message and its attachments and notify postmaster@verticalnet.com
immediately.
============================================================================


Re: MessageBundle

Posted by Oleg V Alexeev <go...@penza.net>.
Hello Simon,

Wednesday, June 20, 2001, 10:31:36 PM, you wrote:

SL> For some reason, Strut can't find my message bundle. For testing purpose, i
SL> have 2 language(thus 2 properties files).
SL> MyResources.properties(default for English)
SL> MyResources_fr.properties(for French)

SL> On the JSP message bean call, the default English works fine. But i can't
SL> get the French version to work. It tells me:
SL> javax.servlet.jsp.JspException: Cannot find message resources under key
SL> MyResources

SL> <!-- jsp code -->
SL> <h3><bean:message bundle="MyResouces" locale="fr" key="um_user.heading"/>
SL>     <%= userSession.getName()%>
SL> </h3>
SL> <!-- end jsp code -->

SL> <!-- the xml config file here -->
SL> <servlet>
SL>         <servlet-name>action</servlet-name>
        
SL> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
SL>         <init-param>
SL>                 <param-name>application</param-name>
SL>                 <param-value>MyResources</param-value>
SL>         </init-param>
SL>         ...
SL> </servlet>

If your work with on bundle only then just remove bundle attribute
form bean:message -

<bean:message locale="fr" key="um_user.heading"/>

-- 
Best regards,
 Oleg                            mailto:gonza@penza.net