struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JOSE L MARTINEZ-AVIAL <jlm...@gmail.com>
Subject Re: Keeping current locale after logging out
Date Thu, 01 Aug 2013 05:00:16 GMT
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 <juntandolineas@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.
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message