It sounds like what you want is either to extend the I18nInterceptor to be aware of your cookie, or simply create a custom interceptor that takes care of setting the locale from the cookie into the session (or exposing it as a request parameter for I18nInterceptor to consume), and put that at the front of your interceptor stack.

L.


Ray Clough wrote:
I really don't see any option to getting the Locale from a cookie, since this is the first 
request of a new user session, and no other facility is available to get it.  The Locale from 
the user request won't do, because that is set to the browser preference, or something.  So 
the question is "how to make this Locale available to the S-2 tags in the login page.  
The interceptor doc says it will be saved for "all future requests".  I need to use 
it for the current request.  It seems that the solution is to push it to the stack or 
something, wherever the S-2 tags get it from.

- Ray Clough

----- Original Message -----
From: "Rene Gielen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: Locale - make available to JSP
Date: Fri, 03 Aug 2007 08:31:22 +0200


Could it be that you are looking for I18nInterceptor?

http://struts.apache.org/2.x/docs/i18n-interceptor.html

Ray Clough schrieb:
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

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




- Ray Clough
[EMAIL PROTECTED]


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

Reply via email to