title: Spring MVC custom errors and internationalization
body: <p>In my web application, I handle errors with annotations. Everything works fine and I can use custom messages via the "message" parameter.</p>
  
  <pre><code>@Digits(fraction = 0, integer = 3, message="my custom error message...")
  private String price;
  </code></pre>
  
  <p>Now I'm trying to internationalize this message with a .properties files, but I certainly miss something and I can't get it to work.</p>
  
  <p>My spring config :</p>
  
  <pre><code>&lt;beans:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
      &lt;beans:property name="basenames" value="classpath:i18n/messages, classpath:i18n/errors" /&gt;
      &lt;beans:property name="defaultEncoding" value="UTF-8" /&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:bean name="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"&gt;
      &lt;beans:property name="validationMessageSource"&gt;
          &lt;beans:ref bean="messageSource" /&gt;
      &lt;/beans:property&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:bean id="localeResolver" class="org.springframework.web.servlet.i18n.FixedLocaleResolver"&gt;
      &lt;beans:property name="defaultLocale" value="fr" /&gt;
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p>My new bean :</p>
  
  <pre><code>@Digits(fraction = 0, integer = 3)
  private String price;
  </code></pre>
  
  <p>My "errors_fr.properties" file. I've already tried everything :</p>
  
  <pre><code>Digits.myBean.myNestedBean.price = my custom error message...
  Digits.myNestedBean.price = my custom error message...
  javax.validation.constraints.Digits.myNestedBean.price = my custom error message...
  </code></pre>
  
  <p>I always get the same generic message from spring, it's like as spring doesn't detect my .properties file. By the way, the message keys above can be found in the BindingResult object when debugging.</p>
  
  <p>What am I missing here ?</p>
  
  <p>Notice that I already have internationalized messages in my jsp's (in the "messages_fr.properties" file) and they work fine.</p>