Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <context-param>
- <param-name>LOCALE</param-name>
- <param-value>en-GB</param-value>
- </context-param>
- java.util.Enumeration<String> setout = servletContext.getInitParameterNames();
- while (setout.hasMoreElements()) {
- String paramName = setout.nextElement();
- configProperties.put(paramName, servletContext.getInitParameter(paramName));
- }
- import javax.servlet.ServletContext;
- import javax.servlet.ServletContextEvent;
- import javax.servlet.ServletContextListener;
- public class AppContextListener implements ServletContextListener {
- @Override
- public void contextDestroyed(ServletContextEvent event) { /* empty. */ }
- @Override
- public void contextInitialized(ServletContextEvent event) {
- /*
- * Default locale
- */
- ServletContext sc = event.getServletContext();
- sc.setAttribute(org.apache.struts.Globals.LOCALE_KEY, "pt_BR");
- }
- }
- Texts_en_GB.properties
- Texts_pt_BR.properties
- Texts.propertiers ( <-- this one will be selected when no resources for requested language could be found)
- <message-resources key="Texts" parameter="com.mycompany.Texts" null="false"/>
- <message-resources key="Texts" parameter="com.mycompany.Texts" null="false">
- <set-property key="mode" value="JSTL" />
- </message-resources>
Add Comment
Please, Sign In to add comment