You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Torsten Römer <to...@luniks.net> on 2007/05/11 10:10:43 UTC

Preparable interface & getLocale()

I noticed that when calling getLocale() from prepare(), it seems to
return the system default locale instead of the locale set by the
request_locale request parameter, which is the case when calling it from
execute().

Is that supposed to be like that or could this be a bug?

I think the correct locale is needed also in prepare() in order to
populate controls with internationalized content. As a workaround I get
the locale directly from the request_locale parameter.

Torsten

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


Re: Preparable interface & getLocale()

Posted by Musachy Barroso <mu...@gmail.com>.
It should be available, if it isn't it is probably a bug.

musachy

On 5/11/07, Torsten Römer <to...@luniks.net> wrote:
>
> I noticed that when calling getLocale() from prepare(), it seems to
> return the system default locale instead of the locale set by the
> request_locale request parameter, which is the case when calling it from
> execute().
>
> Is that supposed to be like that or could this be a bug?
>
> I think the correct locale is needed also in prepare() in order to
> populate controls with internationalized content. As a workaround I get
> the locale directly from the request_locale parameter.
>
> Torsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: Preparable interface & getLocale(

Posted by Torsten Römer <to...@luniks.net>.
Alright, thanks! I should have a look at that interceptor stack stuff
anyway, seems to be very powerful!

Torsten

Musachy Barroso schrieb:
> Yep, Dave is right. I can't think of any reason why the i18 interceptor
> wouldn't be first, but hey, it is friday! Anyway, as a workaround you can
> make your own interceptor stack.
> 
> musachy
> 
> On 5/11/07, Dave Newton <ne...@yahoo.com> wrote:
>>
>> --- Torsten Römer <to...@luniks.net> wrote:
>> > I noticed that when calling getLocale() from
>> > prepare(), it seems to return the system default
>> > locale instead of the locale set by the
>> > request_locale request parameter, which is the case
>> > when calling it from execute().
>> >
>> > Is that supposed to be like that or could this be a
>> > bug?
>>
>> I believe the default interceptor stack has prepare
>> running before i18n.
>>
>> d.
>>
>>
>>
>>
>> ____________________________________________________________________________________Give
>>
>> spam the boot. Take control with tough spam protection in the all-new
>> Yahoo!
>> Mail Beta.
>> http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
>>
>> ---------------------------------------------------------------------
>> 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: Preparable interface & getLocale(

Posted by Musachy Barroso <mu...@gmail.com>.
Yep, Dave is right. I can't think of any reason why the i18 interceptor
wouldn't be first, but hey, it is friday! Anyway, as a workaround you can
make your own interceptor stack.

musachy

On 5/11/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Torsten Römer <to...@luniks.net> wrote:
> > I noticed that when calling getLocale() from
> > prepare(), it seems to return the system default
> > locale instead of the locale set by the
> > request_locale request parameter, which is the case
> > when calling it from execute().
> >
> > Is that supposed to be like that or could this be a
> > bug?
>
> I believe the default interceptor stack has prepare
> running before i18n.
>
> d.
>
>
>
>
> ____________________________________________________________________________________Give
> spam the boot. Take control with tough spam protection in the all-new Yahoo!
> Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: Preparable interface & getLocale()

Posted by Dave Newton <ne...@yahoo.com>.
--- Torsten Römer <to...@luniks.net> wrote:
> I noticed that when calling getLocale() from
> prepare(), it seems to return the system default 
> locale instead of the locale set by the
> request_locale request parameter, which is the case
> when calling it from execute().
> 
> Is that supposed to be like that or could this be a
> bug?

I believe the default interceptor stack has prepare
running before i18n.

d.



       
____________________________________________________________________________________Give spam the boot. Take control with tough spam protection in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html 

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