title: Spring mvc bind errors internatiolization
body: <p>I have some issue with resolving typeMismatch Exceptions on binding. Type mismatch errors don't resolving from my messages.properties.</p>
  
  <p>My controller handler:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)
  public @ResponseBody
      ValidationResponse addOrder(@ModelAttribute(value = PARAM_NAME) @Valid Orders orders, BindingResult bindingResult) {
      ...
  }
  </code></pre>
  
  <p>I getting this messages from bindingResult.</p>
  
  <p>Spring config:</p>
  
  <pre><code>...
  &lt;bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
      &lt;property name="basename" value="/WEB-INF/messages" /&gt;
      &lt;property name="defaultEncoding" value="UTF-8"/&gt;
  &lt;/bean&gt;
  
  &lt;bean name="validator"
        class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"&gt;
      &lt;property name="validationMessageSource"&gt;
          &lt;ref bean="messageSource"/&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  ...
  </code></pre>
  
  <p><code>/WEB-INF/messages.properties</code>:</p>
  
  <pre><code>...
  Orders.width.NotNull=Null error
  Orders.height.NotNull=Null error
  typeMismatch.java.util.Date=Format error
  typeMismatch.java.lang.Integer=Format error
  typeMismatch.java.lang.Long=Format error
  java.lang.NumberFormatException=Format error
  typeMismatch.java.lang.NumberFormatException=Format error
  typeMismatch.java.lang.NumberFormat=Format error
  typeMismatch.orderAdd.width=Format error
  typeMismatch=Format error
  ...
  </code></pre>
  
  <p>For checks like this one:</p>
  
  <pre><code>...
  @NotNull(message="{Orders.width.NotNull}")
  private Long width;
  ...
  </code></pre>
  
  <p>I got correct messages.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>This example prints error messages:</p>
  
  <pre><code>List&lt;FieldError&gt; allErrors = bindingResult.getFieldErrors();
    for (FieldError objectError : allErrors) {
      System.out.println(objectError.getDefaultMessage());
  }
  </code></pre>