Skip to content

Instantly share code, notes, and snippets.

@prayagupa
Last active December 14, 2015 20:08
Show Gist options
  • Save prayagupa/5141600 to your computer and use it in GitHub Desktop.
Save prayagupa/5141600 to your computer and use it in GitHub Desktop.
Spring-GWT i18n
[1] How do you enable LocaleInterceptor to change the locale in spring-security login page?, http://stackoverflow.com/questions/5244776/how-do-you-enable-localeinterceptor-to-change-the-locale-in-spring-security-logi
/**
* Spring conf
*/
<!-- controllers.xml -->
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="en"/>
</bean>
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
= [How do you enable LocaleInterceptor to change the locale in spring-security login page?](http://stackoverflow.com/a/8617385/432903)
<mvc:annotation-driven />
<mvc:interceptors>
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
</mvc:interceptors>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="np" />
</bean>
Configuring locale switching with Spring MVC 3, http://templth.wordpress.com/2010/07/21/configuring-locale-switching-with-spring-mvc-3/
/**
* Spring controller
*/
{
//...
String locale = RequestContextUtils.getLocale(httpRequest).getLanguage();
modelMap.put("locale", locale);
return "main";
}
/**
* in gwt-hosting.jsp
*/
<c:if test="${isgwt}">
<meta name="gwt:property" content="locale=${locale}">
</c:if>
/**
* eccount.gwt.xml
*/
GWT Performance Reference
Java HotSpot VM Options,
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
Tuning Garbage Collection with the 1.4.2 Java[tm] Virtual Machine, http://www.oracle.com/technetwork/java/gc1-4-2-135950.html#3.%20Sizing%20the%20Generations|outline
November 30th, 2007 by Rob van Maris, http://blog.trifork.com/2007/11/30/optimizing-startup-time-for-gwt-hosted-mode/
https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/fTP5vKTvtKY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment