In my application, I have to display the content based on the locale that an user has chosen in the configuration page. I am not using a browser default locale.
when using <s:text>
, it always use the default resource file.
In Struts1, I have used the below code to set default locale in my filter
session.setAttribute("org.apache.struts.action.LOCALE",locale);
How to set the user chosen locale dynamically in Struts2 ?
You set the locale in the following way in Struts 2:
You can also use the
I18nInterceptor
.