My question is basically the same as user confirmation for bean verification . However, I can not solve the problem.
Bean class:
public class PersonalInfoBean {
@Size(min=5, max=55, message="{invalid_name}")
String name;
...
}
I created Message.properties in the package in the src folder of the Eclipse project.
invalid_name=Please enter a valid name
I registered the file in faces-config.xml:
<application>
<message-bundle>com.webage.survey.Messages</message-bundle>
</application>
The facelet file has:
<h:inputText value="#{personalInfo.name}" id="name"/> <h:message for="name" style="color: red" /><br/>
When I submit the form, I see only {invalid_name} as an error message, and not "Please enter a valid name."
I tested this with JBoss 6 and WebSphere 8 with the same result.
source
share