You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marcin Zajączkowski <ms...@wp.pl> on 2013/11/25 17:31:59 UTC

Change a session locale using a GET parameter

Hi,

In the application an user should be able to change session locale with
a GET parameter (e.g. ?locale=pl). I implemented it in onConfigure for
my abstract WebPage where I check if the parameter exists and change
session locale and it works fine.

Nevertheless I wonder if it is a proper place for that action? Or maybe
I can tell Wicket to automatically use locale from every Request (not
only once when a session is created)?

Marcin

-- 
http://blog.solidsoft.info/ - Working code is not enough


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


Re: Change a session locale using a GET parameter

Posted by Marcin Zajączkowski <ms...@wp.pl>.
On 2013-11-25 17:45, Martin Grigorov wrote:
> Hi,
> 
> See
> https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java?source=cc
> 
> You can read the parameter from the query string.

Great, thanks Martin.

Marcin


> On Mon, Nov 25, 2013 at 6:31 PM, Marcin Zajączkowski <ms...@wp.pl> wrote:
> 
>> Hi,
>>
>> In the application an user should be able to change session locale with
>> a GET parameter (e.g. ?locale=pl). I implemented it in onConfigure for
>> my abstract WebPage where I check if the parameter exists and change
>> session locale and it works fine.
>>
>> Nevertheless I wonder if it is a proper place for that action? Or maybe
>> I can tell Wicket to automatically use locale from every Request (not
>> only once when a session is created)?
>>
>> Marcin


-- 
http://blog.solidsoft.info/ - Working code is not enough



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


Re: Change a session locale using a GET parameter

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

See
https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java?source=cc

You can read the parameter from the query string.


On Mon, Nov 25, 2013 at 6:31 PM, Marcin Zajączkowski <ms...@wp.pl> wrote:

> Hi,
>
> In the application an user should be able to change session locale with
> a GET parameter (e.g. ?locale=pl). I implemented it in onConfigure for
> my abstract WebPage where I check if the parameter exists and change
> session locale and it works fine.
>
> Nevertheless I wonder if it is a proper place for that action? Or maybe
> I can tell Wicket to automatically use locale from every Request (not
> only once when a session is created)?
>
> Marcin
>
> --
> http://blog.solidsoft.info/ - Working code is not enough
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>