Hi List,

if Tapestry recieves a request that does not contain the locale at the beginning of the uri, it will determine the desired locale from the request headers and send the respond. The PersistentLocale will not be set.

In that case I want to set the PersistentLocale and send a redirect to the client to ensure the locale is allways part of every uri. My first idea was to implement a RequestFilter. But it turned out, even if the uri contained the locale, the PersistentLocale was not set (yet). Same with Dispatchers.

I dug into Tapestry's source code and found out that PersistentLocale is set in ComponentEventLinkEncoder's decode methods. From that I judged I would only have access to PersistentLocale from within pages or components.

So I implemented an abstract BasePage that checks PersistentLocale.isSet in its onActivate method and sends the redirect, if necessary. All my pages inherit from BasePage,

Now I am wondering, if there is a smarter approach?

Thanks in advance,
nillehammer

--
http://www.winfonet.eu

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

Reply via email to