I am changing locale from an Action, then returning a "redirect" result to
refresh the page.  However, the new locale is not being fetched into the
<s:text../> tags.  <s:text.../> insists in fetching messages from the old
locale.  I already checked to make sure I have the resource bundles files in
the classpath.  And all the configuration appears correct.

Here is the code that changes the locale:

... // this.locale contains the new locale 
session.put(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE, this.locale);
ActionContext.getContext().setLocale(this.locale);

I even wrote a LocaleFilter to enforce the new locale on the ActionContext
after a re-direct:

        // tries to resolve locale from session attributes
        Locale locale = LocaleUtils.resolveLocale((HttpServletRequest)
request);
        // I see the new locale set here
        if (logger.isDebugEnabled())
        {
            logger.debug("configuring locale [" + locale +
                "] on Spring LocaleContextHolder and Struts ActionContext");
        }

        // set locale on the Struts ThreadLocal Context
        ActionContext.getContext().setLocale(locale);

        chain.doFilter(request, response);
       ....

Why is <s:text name="text.login.newUser" /> still fetching values from the
default locale?

Rubens

-- 
View this message in context: 
http://www.nabble.com/-S2--s%3Atext-after-locale-change-displays-old-locale-values--tp15655762p15655762.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to