[jboss-user] [JBoss Seam] - Re: Form Validation Question:Entity Bean @NotNull vs. requir

pete.muir@jboss.org do-not-reply at jboss.com
Tue Jan 15 06:14:34 EST 2008


"Marx3" wrote : so if there will not be required=true for example on email field (but @Email will be defined on column in @Entity bean) validateAll will not validate and there will be persistance exception?
  | Is this bug or by design? It makes s:validateAll rather useless...

JSF doesn't attempt to validate fields which are empty. Hence trying to validate with @NotNull doesn't work.

So, in your example, if you had (with person.email being annotated with @Email)

<h:inputText value="#{person.email}" />

then, if you didn't enter a value, validation would pass, if you entered an invalid email address it would fail, if you entered a valid email address it would pass. If you added required="true" you would have to enter a value.

Seam can't fix this, a new JSF would be needed.

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

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



More information about the jboss-user mailing list