Problem: After validating a form, the error message is always displayed in
German
although I have set a different locale and the rest of the page is displayed
in English.
Even the fallback locale is set to English. I must have introduced 
this problem somewhere, but I have no idea where. Here are the facts:


1. I set the locale programmatically depending on the current user's
language.
   To do this I replaced the LocaleFilter by my own version. I wrote about
   that 
http://www.nabble.com/How-to-change-the-locale-programmatically-td18706402s2369.html#a18706402
here .
   
   User's language is English --> both locale values are set to "en": locale
and preferredLocale

2. ActionContext.getContext().getLocale();   --> returns "en"

3. here are the request attributes of my locale filter: is there any
critical information?

...lazyLoadingFilter.FILTERED: true
...encodingFilter.FILTERED: true
..._clickstream_filter_applied: true
...localeFilter.FILTERED: true
...__spring_security_filterSecurityInterceptor_filterApplied: true
...__spring_security_session_integration_filter_applied: true
...__spring_security_session_fixation_filter_applied: true
...org.springframework.web.context.request.RequestContextListener.REQUEST_ATTRIBUTES:
GET /images/iconWarning.gif HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.9.0.3)
Gecko/2008092417 Firefox/3.0.3
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language:
de-DE,de;q=0.9,en-GB;q=0.9,en;q=0.8,en-US;q=0.7,en-gb;q=0.6,fr-FR;q=0.6,fr;q=0.5,it-IT;q=0.4,it;q=0.4,nl-NL;q=0.3,nl;q=0.2,en-us;q=0.1,en;q=0.1
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:8080/saveName.html
Cookie: username=admin; JSESSIONID=ggbhxjwlxm4h

4. ApplicationResources* are correct. Nothing hard-coded here.

5. Nothing hard-coded into the project that fixes the language to German.

6. Tested with local Tomcat and Jetty. Same behaviour.

7. Cleared Firefox cache. No difference.

8. However, we have packed a version a few days ago and this has no
problem. I have no idea what I might have changed meanwhile that 
is responsible for this behaviour.

9. Even when my user has set language to English, and getLocale returns
the French locale, validation message is in German. 

Question is: Does validation and retrieval of error messages get the locale
from somewhere else? Or is it preceeding the LocaleFilter? I have no clue.

At least, I know why the language is German. I live in Germany. 


-- 
View this message in context: 
http://www.nabble.com/Locale-problem-after-Struts2-validation-tp19900222s2369p19900222.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


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

Reply via email to