Skip to content

Instantly share code, notes, and snippets.

@benelog
Created January 13, 2012 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benelog/1605099 to your computer and use it in GitHub Desktop.
Save benelog/1605099 to your computer and use it in GitHub Desktop.
Spring i18n
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<fmt:message key="main_hello">
<fmt:param>benelog</fmt:param>
</fmt:message>
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="lang"/>
</mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.CookieLocaleResolver" id="localeResolver" p:cookieName="lang"/>
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource"
p:basenames="WEB-INF/messages/messages,WEB-INF/i18n/application" p:fallbackToSystemLocale="false"/>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<spring:message code="main_hello" arguments="benelog!"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment