struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "None None" <>
Subject RE: MessageResources Problem in Action
Date Tue, 01 Jun 2004 13:15:55 GMT
I use the following code:


I have two property files, and  The above code fetches the 
messages.deleteFailed message from the appropriate file, depending on what 
the current Locale is.  Note that Struts seems to be smart enough to just 
use the _en or _de portion of the Locale, it looks to ignore the _AT (the 
country code I think?) portion of it.  Not sure this is truly a good thing, 
but it seems to be the case in my experience.

>From: Ralf Schneider <>
>Reply-To: "Struts Users Mailing List" <>
>To: Struts Users Mailing List <>
>Subject: MessageResources Problem in Action
>Date: Tue, 1 Jun 2004 12:23:23 +0200
>I want to access the strings in a resource bundle from within an action. I
>have two resource files ( and
> and they are accessed correctly from 
>JSP, but not from the action.
>When I look at the locale with request.getLocale() in the action I see that 
>is set to de_AT. This is what I expected. Unfortunately, the strings are
>fetched from, not from
> as they should be.
>I use this code to get a string from the resource bundle:
>	MessageResources messages = getResources (request);
>	String msg = messages.getMessage("");
>Any ideas what might be the problem?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Learn to simplify your finances and your life in Streamline Your Life from 
MSN Money.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message