You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JOSE L MARTINEZ-AVIAL <jl...@gmail.com> on 2013/08/01 07:00:16 UTC

Re: Keeping current locale after logging out

The closeSession redirects to a new page? In that case the setLocale is
lost (it only lives during the request) and the new local is picked up from
the browser language, or from the default language you have setup.


2013/7/31 Antonio Sánchez <ju...@gmail.com>

> At logging out, session is invalidated and redirected page is displayed in
> default language.
>
> Say: default language: Spanish; current language: English; logging out and
> resulted page is in Spanish, but should be English. .
>
> This is not working (code in action class):
>
>     public String closeSession()  {
>         Locale currentLocale = ActionContext.getContext().getLocale();
>         request.getSession().invalidate();
>         ActionContext.getContext().setLocale(currentLocale);
>         return SUCCESS;
>     }
>
> How to maintain the current language?
>
> Thanks.
>
>
>