[jboss-user] [JBoss Seam] - Seam + Hibernate-Validator validation problem

axismundi do-not-reply at jboss.com
Tue Oct 30 09:56:44 EDT 2007


Following the Seam-manual we are experiencing trouble to get validation running with Seam 2.0.CR2/Icefaces 1.6.1

JSF:

<ice:outputLabel for="firstName" value="Vorname"  />
  | <ice:inputText id="firstName" value="#{checkoutCart.bean.firstName}" required="true"/>
  | <br/><h:message for="firstName" />
  | 

Bean-class:
@NotNull
  | @Pattern(regex="^[a-zA-Z.-]+", message="Fehlender oder ungültiger Nachname")
  | @Override
  | public String getFirstName() {
  | 	return firstName;
  | }

With this code, leaving the field _blank_ results in "value is required"-message, coming from the JSF-implementation. The custom message "Fehlender..." is ignored.
If an _invalid_ value is entered, the correct error-message appears

Replacing 
<h:message for="firstName" />
with 
<s:message for="firstName" /> doesnt change anything.

Obviously, using required="true"  prevents Seam from handling the validation. Any solution for this available, or better to use standard-JSF validation?



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100272#4100272

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100272




More information about the jboss-user mailing list