I have a strange problem using Spring MVC message bundles: the wrong message bundle file is being fetched. I have double-checked, and in my Java controller class I have the fr_FR locale, but Spring tags (appContext.getMessage(code, null, locale);
in the class as well) return me English messages!
What is going on?
I am developing portlets for Liferay Portal. Let me show you parts of my code:
in applicationContext.xml:
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>messages</value>
</list>
</property>
</bean>
in my JSPs I have code looking like this:
...
<spring:message code="button.help"/>
...
and the paths to my messages look like this:
development:
deployed in Tomcat
I had a similar issue when my localized message file had a bad unicode character (the \uXXX form).
Neither Java, Spring nor Tomcat did write an information about it, no feedback at all.
After fixing the file, everything suddenly started to work.
Regards