I have a webapp that uses Struts 2. I use the i18n interceptor with all the default settings. I thought this interceptor worked as follow:
- If there is a parameter request_locale, remove this parameter and place this locale in the session for future use.
- If there is NO parameter, search the httpheader for the locale and place this locale in the session for future use.
So in my action class (which implements sessionAware) I have the following method:
public String getUserLocale()
{
return (String) session.get("WW_TRANS_I18N_LOCALE");
}
However, this method does not work in situation #2, it just returns null. So my question is: how can I let my action know the user locale that the i18n interceptor detected if there is no explicit request parameter? Because it is not stored in the session?