We are trying to implement internationalization using Spring ResourceBundleMessageSource and FMT. But when we use it in the JSP, pages are displaying value as ???message.key???. Can you please help us in resolving this behavior? Really appreciate your answers.
Below are the configuration:
spring-servlet.xml entry
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>WEB-INF/messages/msgs</value>
</property> </bean>
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName">
<value>locale</value>
</property> </bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
<property name="interceptors">
<list>
<ref bean="localeChangeInterceptor" />
</list>
</property>
</bean>
IN the JSP we have added the imported
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:message key="message.key"/>
Also in the war created we have the msgs.properties file under WEB-INF/messages folder.
Really appreciate help in identifying the mistake we are making. Thank you.