You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcel Stör <ma...@frightanic.com> on 2005/04/25 14:23:37 UTC

MessageTag set specific Local

Hi all,

Had my first Struts experiences yesterday...
MessageTag uses the browser's language settings to determin the Locale,
which is being used to retrieve language-specific messages. So far so good.
How can I force MessageTag to use a particular Locale for a request? The API
suggests to use the tag's "locale" attribute. However, the Struts source
code doesn't seem to backup this assumption.
What's the solution here?

-- 
Marcel Stör
http://www.frightanic.com



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


Re: MessageTag set specific Local

Posted by delbd <de...@oma.be>.
You can also change the locale by mapping 
org.apache.struts.actions.LocaleAction to locale.do in your struts-config.xml, 
using a dynaform.
The user can then switch language using somthing like 
locale.do?language=fr&country=be&page=/jsps/myjsptogoto.jsp

country and page are optional arguments.

regards,
-- 
David Delbecq
Royal Meteorological Institute of Belgium
Le Lundi 25 Avril 2005 22:25, Marcel Stör a écrit :
> vinod perla <ma...@gmail.com> wrote:
> > vinod wrote:
> >                 u can set to a specific Locale in the Action Class by
> > calling the method setLocale(HttpServletRequest
> > request,java.util.Locale locale).The default scope of this is session.
>
> So, what you're saying is, that one cannot set the specific Locale in the
> JSP where the tag is employed?
>
> Regards,
> Marcel
>
>
> ---------------------------------------------------------------------
> 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


RE: MessageTag set specific Local

Posted by Marcel Stör <ma...@frightanic.com>.
vinod perla <ma...@gmail.com> wrote:
> vinod wrote:
>                 u can set to a specific Locale in the Action Class by
> calling the method setLocale(HttpServletRequest
> request,java.util.Locale locale).The default scope of this is session.

So, what you're saying is, that one cannot set the specific Locale in the
JSP where the tag is employed?

Regards,
Marcel


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


Re: MessageTag set specific Local

Posted by vinod perla <vi...@gmail.com>.
vinod wrote:
                u can set to a specific Locale in the Action Class by
calling the method setLocale(HttpServletRequest
request,java.util.Locale locale).The default scope of this is session.
regards
vinod

On 4/25/05, Marcel Stör <ma...@frightanic.com> wrote:
> Hi all,
> 
> Had my first Struts experiences yesterday...
> MessageTag uses the browser's language settings to determin the Locale,
> which is being used to retrieve language-specific messages. So far so good.
> How can I force MessageTag to use a particular Locale for a request? The API
> suggests to use the tag's "locale" attribute. However, the Struts source
> code doesn't seem to backup this assumption.
> What's the solution here?
> 
> --
> Marcel Stör
> http://www.frightanic.com
> 
> ---------------------------------------------------------------------
> 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