public final class LocaleAction extends Action  {

.....
....

HttpSession session = request.getSession();
Locale locale = getLocale(request);

String language = null;

language = (String)    PropertyUtils.getSimpleProperty(form,
"language");

   if (language != null && language.length() > 0) {
           locale = new java.util.Locale(language, "");
    }

                I DON'T USE THIS ---->
Locale.setDefault(Locale.FRENCH);

                I USE THIS ---->
session.setAttribute(Globals.LOCALE_KEY, locale);

        return mapping.findForward("success");


-----Mensaje original-----
De: Jurn Ho [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 24 de octubre de 2005 15:29
Para: Struts Users Mailing List
Asunto: Re: i18n and same value for 2 different locale


I'd be very interested if you find out what is wrong..
We have a similar issue that only appears sometimes to our webapp 
when its deployed to a websphere server. Our other environments that 
run tomcat have never exhibited this problem.

Jurn

At 07:52 AM 22/10/2005, Christian Bourque wrote:
>Hi!
>
>I got a weird problem with my application (only in production), the 
>problem is intermittent and I wasn't able to reproduce it yet.
>
>Sometimes the messages returned by bean:message aren't correct (english

>when it should be french and vice versa). I did a test in a jsp for a 
>specific key and the value returned was in english for a french locale 
>??? What is weird is that it doesn't apply to all messages on the page,

>some messages are in french and the others in english ??? It's like at 
>some point the Struts messages cache got corrupted...
>
>I have two properties file :
>
>- application.properties (default french)
>- application_en.properties (english)
>
>A default locale is set in my init servlet :
>
>Locale.setDefault(Locale.FRENCH);
>
>I never experienced the same behaviour on my development workstation 
>(XP), the production server runs Linux (SUSE)...
>
>I reloaded the properties files live on the production with this code 
>in a jsp (ugly hack) :
>
>MessageResourcesFactory factory 
>=MessageResourcesFactory.createFactory();
>MessageResources resources
=factory.createResources("resources.application");
>application.setAttribute("org.apache.struts.action.MESSAGE",
resources);
>
>And everything went back to normal (until next time)...
>
>I would appreciate any suggestions!
>
>Regards,
>
>Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to