Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Locale - make available to JSP

Ray Clough

2007-08-02

Replies:


The first page of my app is a Login page. Every other page is correctly
localized, because the app gets the user's preferred locale from a DB, and
Struts handles it, but until they have logged in the DB is not available. I
want it to be localized from cookies. I created a filter which intercepts
the requests, gets the cookie from the request, and creates a Locale object
for that language. The cookie was stored when the user selected a Locale in
a previous session. The question is, where do I store this locale so that
it is available to the login page. I looked into the source code for the
ActionContext class, LocaleProvider class, etc, and it seems like this code
should work, but it doesn't:  
ActionContext.getContext().put(ActionContext.LOCALE, locale);

Any help or advise will be greatly appreciated.

Thank you,
Ray Clough

--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.