9 Replies Latest reply on Aug 20, 2007 11:53 AM by Jack Shen

    Hibernate validation not working in Seam...

    Jack Shen Newbie

      Hi all,

      I've got this annotated model class shown below:

      @Entity
      @Name("contact")
      @Table(name = "contacts")
      public class Contact extends Model implements Serializable {
      ...
       @Length(min = 5, max = 50)
       public String getContactName() {
       return contactName;
       }...
      


      When I enter an invalid value in the form field and press the submit button(using Ajax4JSF), the form validation works, but if I leave the form field blank, I was redirected to the JBoss Seam Debug page saying that validation failed for org.jaden.antipim.entity.Contact. I'm guessing that it has something to do with the hibernate pre-insert validation, but I checked the source code in hibernate validator and found that null and empty values are accepted and should pass the validation. So does anyone have any ideas or suggestions?

      P.S. I'm currently using JBoss Seam 2.0.0Beta1 with Ajax4JSF for handling a form.