title: Spring Message Interpolation Argument Replacement using Hibernate Validator
body: <p><a href="https://docs.jboss.org/hibernate/validator/5.0/reference/en-US/html/chapter-message-interpolation.html" rel="nofollow">https://docs.jboss.org/hibernate/validator/5.0/reference/en-US/html/chapter-message-interpolation.html</a></p>
  
  <p>According to the hibernate validation documentation, the following can be done where {min} and {max} parameters are replaced in error message accordingly.</p>
  
  <pre><code> @Size(
              min = 2,
              max = 14,
              message = "The license plate must be between {min} and {max} characters long"
      )
  </code></pre>
  
  <p>I am using this notation in a Spring application but these arguments are not replaced.
  I get back "The license plate must be between min and max characters long"</p>
  
  <p>Do I need to configure the validator differently to make this work?</p>
  
  <p>Here is my configuration:</p>
  
  <pre><code>&lt;bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
  &lt;property name="basenames"&gt;
  &lt;list&gt;
  &lt;value&gt;messages&lt;/value&gt;
  &lt;/list&gt;
  &lt;/property&gt;
  &lt;property name="defaultEncoding" value="UTF-8"/&gt; 
  &lt;property name="useCodeAsDefaultMessage" value="true"/&gt;
  &lt;/bean&gt;
  
     &lt;bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"&gt;
          &lt;property name="validationMessageSource" ref="messageSource"/&gt;
      &lt;/bean&gt;
  </code></pre>