Am I right if I say that Tapestry does not use a cookie anymore to persist
the locale ? And that the PersistentLocale does not persist the locale
accross a request ?
(Comparing to Tapestry 5.0.18)
Stephan Windmüller-8 wrote:
>
> On Fri, 18. Sep 2009, Stephan Windmüller wrote:
>
>> > Use a RequestFilter for setting the locale.
>> But I am unsure about how to implement this.
>
> Okay, I asked for help a little too quickly. Some things I figured out
> myself, but still the filter does not work.
>
>> Additionally I have to figure out if the user is logged in because
>> otherwise the database will return an error when I receive the saved
>> locale. The Request class does not have getRemoteUser().
>
> Here I used RequestGlobals.
>
>> And is it possible to use Beans in the RequestFilter which I would
>> Inject on normal pages?
>
> That is possible using the build-Methods in AppModule itself.
>
> So my code looks now like this:
>
> public RequestFilter buildLocaleFilter(final RequestGlobals globals,
> final PersistentLocale persistentLocale){
> return new RequestFilter(){
> public boolean service(Request request, Response response,
> RequestHandler handler) throws IOException {
> if (globals.getHTTPServletRequest().getRemoteUser() != null) {
> Locale preferredLanguage =
> getDatabaseUser().getPreferredLanguage();
> persistentLocale.set(preferredLanguage);
> }
> return handler.service(request, response);
> }
> };
> }
>
> According to the debug output the locale is set, but that did not change
> anything on the page.
>
> - Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Using-locale-from-user-setting-after-login-tp25491734p25530316.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]