struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea M" <andrea.missin...@fastwebnet.it>
Subject R: R: Sharing what I've learned: locale switching
Date Mon, 17 May 2004 19:34:34 GMT
Hi again
I'm afraid I was kind of inaccurate in my previous answer
you can retrieve session from the request, but that's only with forwards of
course, and forwards work only in the same application.

What you can do  is to share your objects putting them in JNDI. JNDI tree is
shared between all of your contexts, and it's replicated, so it's
cluster-safe.

Of course you should make sure to have set your object before accessing it
from another app, but that's obvious.

Hope that helps



-----Messaggio originale-----
Da: Jan Normann Nielsen [mailto:lists@dubbekarl.dk] 
Inviato: lunedì 17 maggio 2004 14.31
A: Struts Users Mailing List
Oggetto: Re: R: Sharing what I've learned: locale switching

Andrea M. wrote:

>Hi Jan
>What do you mean with "sharing user chosen locale"?
>Does your user access thru a common login application?
>If it's something like that, then you might share your Locale putting it in
>session
>Session.setAttribute("myLocale", myLocale);
>
>Then retrieving it in the other applications with
>(Locale)request.getSession().getAttribute("myLocale);
>
>This usually works pretty well since Session is a serializable object.
>Not sure it would work in a clustered environment though
>  
>
I have no problem putting the locale in the session if it wasn't for the 
fact that each deployed web application has its own session handler, so 
the locale is not shared between web applications. It this possible?

Best regards,
Jan Nielsen

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message