Well, to be more specific on the question "How could I get the user locale,.." Here is what I do in an applications which supports 3 language:
1) All incoming requests are filtered. If the session is new the browsers locale is investigated and stored in a session object alng with other values we need during a session. If the user's locale is not supported I store a supported locale and sets the Globals.LOCALE_KEY to this value, too 2) A user can change the language of his session during the session by choosing a link. This calls an Actio which changes the locale in the user session object and the Globals.LOCALE_KEY 3) During a session dates, currencies and so on are shown according to one of the supported languages. When we need to format in utility classes like various fileprinter we just fetch the locale from the session object. The application uses Tiles and this works well. -- Flemming -----Oprindelig meddelelse----- From: delbd [EMAIL PROTECTED] Date: Wed, 9 Mar 2005 11:57:11 +0100 To: "Struts Users Mailing List" user@struts.apache.org Subject: Re: How to get the user locale from a jsp > Unfortunately, this is the locale sent by browser only. Struts store the us> > er > locale in session under the key Globals.LOCALE_KEY. There is a util class > which get this info from session and, if this is empty, return the browser> > locale. So it is possible to programmatically change the user locale. > Unless there is some magic filter in struts which alters the locale stored > > in > the request object by copying the session locale into it, accessing ther > request.getLocale() is of no help as end user can not change his locale by> > clicking on a link. > > So what am asking is , is ther a way to use that util class of struts witho> > ut > resorting to the use of a scriptlet. > > Le Mercredi 9 Mars 2005 11:44, Flemming G. Jensen a écrit : > > You get the local object from the request with the getLocale() method.. > > > > --Flemming > > > > -----Oprindelig meddelelse----- > > From: delbd [EMAIL PROTECTED] > > Date: Wed, 9 Mar 2005 10:14:36 +0100 > > To: user@struts.apache.org > > Subject: How to get the user locale from a jsp > > > > > Hello > > > > > > How could i get the the user locale, as a page scoped bean, from struts. > > > I know there is a struts util class to get the user locale, but i would > > > like to get it without resorting to the use of a scriptlet. > > > > > > Is there a more elegant way of doing this? > > > > > > I need pass the user selected language as a parameter to a flash. > > > > > > Thanks. > > > -- > > > David Delbecq > > > Royal Meteorological Institute of Belgium > > > > > > --------------------------------------------------------------------- > > > 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] > > -- > David Delbecq > Royal Meteorological Institute of Belgium > > --------------------------------------------------------------------- > 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]