title: Spring MVC localization - properties file not being found
body: <p>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...</p>
  
  <p>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.</p>
  
  <p>The exception:</p>
  
  <pre><code>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'.
  </code></pre>
  
  <p>Here's the JSP entry (the fmt:message just shows ???test.testMessage??? while the spring:message blows up):</p>
  
  <pre><code>&lt;h2&gt;&lt;fmt:message key="test.testMessage" /&gt;!&lt;/h2&gt;
  &lt;h2&gt;&lt;spring:message code="test.testMessage" /&gt;!&lt;/h2&gt;
  </code></pre>
  
  <p>Here's the configuration in my comparison-servlet.xml file:</p>
  
  <pre><code>&lt;bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
      &lt;property name="basename" value="messages" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Here's the war structure (note that I added the messages.properties at pretty much every level):</p>
  
  <pre><code>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
          ...
  </code></pre>
  
  <p>Any idea why it can't find a file that is definitely there? Do I need to explicitly set something regarding the classpath?</p>