I'm trying to get basic localization working in a new Spring MVC app. I've tried everything I can think of but always end up with the following exception, regardless of what I do. Any help would be greatly appreciated...
I've tried adding the properties file to every single directory but it still gives me an error. Once I get it working I'll systematically remove extras.
The exception:
07/13/2012 21:06:00.178 [DEBUG] [org.springframework.context.support.ReloadableResourceBundleMessageSource] No properties file found for [messages] - neither plain properties nor XML
07/13/2012 21:06:00.178 [DEBUG] [org.springframework.context.support.ReloadableResourceBundleMessageSource] No properties file found for [messages_en] - neither plain properties nor XML
07/13/2012 21:06:00.179 [DEBUG] [org.springframework.context.support.ReloadableResourceBundleMessageSource] No properties file found for [messages_en_US] - neither plain properties nor XML
07/13/2012 21:06:00.182 [ERROR] [org.springframework.web.servlet.tags.MessageTag] No message found under code 'test.testMessage' for locale 'en_US'.
javax.servlet.jsp.JspTagException: No message found under code 'test.testMessage' for locale 'en_US'.
Here's the JSP entry (the fmt:message just shows ???test.testMessage??? while the spring:message blows up):
<h2><fmt:message key="test.testMessage" />!</h2>
<h2><spring:message code="test.testMessage" />!</h2>
Here's the configuration in my comparison-servlet.xml file:
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="messages" />
</bean>
Here's the war structure (note that I added the messages.properties at pretty much every level):
messages.properties
src
messages.properties
main
messages.properties
java
...
resources
messages.properties
webapp
index.jsp
messages.properties
WEB-INF
comparison-servlet.xml
web.xml
messages.properties
jsp
messages.properties
compare.jsp
globalIncludes.jsp
classes
messages.properties
resources
messages.properties
test
...
Any idea why it can't find a file that is definitely there? Do I need to explicitly set something regarding the classpath?