Rubens wrote:
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
Are the resource bundle files names correctly? Are they in the right
place? Are they being deployed correctly?
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]