title: How supply translated custom error message for JSR 303 bean validation?
body: <p>My question is basically same as  <a href="https://stackoverflow.com/questions/8048710/custom-validation-message-for-bean-validation">Custom validation message for bean validation</a>. However, I can't fix the problem.</p>
  
  <p>The bean class:</p>
  
  <pre><code>public class PersonalInfoBean {
      @Size(min=5, max=55, message="{invalid_name}")
      String name;
      ...
  }
  </code></pre>
  
  <p>I created Messages.properties in a package in the src folder of Eclipse project.</p>
  
  <pre><code>invalid_name=Please enter a valid name
  </code></pre>
  
  <p>I registered the file in faces-config.xml:</p>
  
  <pre><code>&lt;application&gt;
      &lt;message-bundle&gt;com.webage.survey.Messages&lt;/message-bundle&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>The facelet file has:</p>
  
  <pre><code>&lt;h:inputText value="#{personalInfo.name}" id="name"/&gt; &lt;h:message for="name" style="color: red" /&gt;&lt;br/&gt;
  </code></pre>
  
  <p>When I submit the form, I see only {invalid_name} as error message and not "Please enter a valid name". </p>
  
  <p>I tested this with JBoss 6 and WebSphere 8 with the same result.</p>