You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Malin Ljungh <ma...@kvadrat.se> on 2006/10/10 20:20:59 UTC

Setting locale based on querystring

I've seen this issue before on this list but not seen any satisfying
solution.

This is my problem:
Based on the querystring to one of my tap pages (it is a link from outside)
I derive the locale that I wan't to use to display the requested page.
In other part of my app I use a DirectLink and a listener to switch locale:

getPage().getEngine().setLocale(new Locale(language));
getPage().getRequestCycle().cleanup();
throw new PageRedirectException(this.getPage());

and that works fine! Though, if I put the same code in my page mentioned
earlier, in the pageBeginRender listener method, I will get an exception
page telling that a PageRedirectException has occurred.
So, it doesn't work (why?)

How should it be done?

Any help highly appreciated.