Question

I have creating login page in that, I am taking user's prefered language from drop down list. After successful login, selected locale will be used rather than Browser's locale

For aformentioned scenario, I am tring below code

        Locale.Builder langBuider = new Locale.Builder();
        langBuider.setLanguageTag( getSelectedLocale() );
       getEngine().setLocale( langBuider.build() );

Even after this locale is not getting updated. I found that to make it effective from same request, I have to change recreate page with updated locale

       IRequestCycle requestCycle = getRequestCycle();
       requestCycle.cleanup();
       requestCycle.activate( "Home" );

but after adding this code Tapestry throws exception

Was it helpful?

Solution

I was also facing similar problem. I have done little modification

IPage page = requestCycle.getPage( "pageName");
requestCycle.activate( page );

This works for me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top