I’m doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate Provider. The application run on Tomcat 6.X.
The web-app can be show in different languages : en , es , fr.
I use the bean validation in my entities. Hibernate Validator is the provider, version 4.2.0.Final.
<h:form id="SiteCreationForm">
<pou:messages />
<pou:fieldset legend="#{messages['siteCreation.detail']}">
<h:panelGrid columns="2">
<h:outputLabel for="siteVisualId" value="#{messages['siteCreation.url']} :" />
pou is primefaces
In my entity, I have this:
@Size(max = 20)
@NotBlank
@Basic(optional = false)
@Column(name = "visual_id", length = 20, unique = true)
private String visualId;
I don’t know why but the error message display only the “may not be empty”, its doesn’t display the input id or the label . Why, how can I fix this ?
The same happen with the required attribute on input.
Thanks.
In the JSF validation message bundle which you specified (or need to specify) in
<message-bundle>offaces-config.xml, add the following entry:The
{0}is the message of the bean validator and the{1}is the label of the JSF component.