You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nathan Quirynen <na...@pensionarchitects.be> on 2015/06/25 13:36:40 UTC

Locale in ComponentRequestFilter

Hi,

I need the Locale inside an implementation of ComponentRequestFilter. So 
I injected Request and use Request.getLocale(). But it seems that this 
will always return the default locale (browser locale ?). I guess this 
is because the setting of the locale happens after my component request 
filters (PageRenderDispatcher ?).

In Request.getPath() I can see the locale I need though, so I could get 
it using substring method.

I'm just wondering if I'm right in my conclusions and if using 
request.getPath() is the only (and right) way to get what I want?

Greetings,
Nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Locale in ComponentRequestFilter

Posted by Nathan Quirynen <na...@pensionarchitects.be>.
I think I found what I need: PersistentLocale

So I just inject PersistentLocale in my component request filter and 
this seems to give what I need :)

So I'm guessing the locale in the request is always what was sent by the 
client (browser locale) and not what has been set in the application?

On 25/06/15 13:36, Nathan Quirynen wrote:
> Hi,
>
> I need the Locale inside an implementation of ComponentRequestFilter. 
> So I injected Request and use Request.getLocale(). But it seems that 
> this will always return the default locale (browser locale ?). I guess 
> this is because the setting of the locale happens after my component 
> request filters (PageRenderDispatcher ?).
>
> In Request.getPath() I can see the locale I need though, so I could 
> get it using substring method.
>
> I'm just wondering if I'm right in my conclusions and if using 
> request.getPath() is the only (and right) way to get what I want?
>
> Greetings,
> Nathan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org