0 Replies Latest reply on Feb 24, 2009 11:57 PM by zzuli

    @NotNull  validator  doesn't  work

      Hi,everybody:
      I'm using hibernate annotation validator with jseam.
      I annotated a pojo, for example:
      @NotNull
      @Range(min = 3, max = 100, message = "Age must be between 3 and 100")
      public int getAge() {
      return age;
      }

      public void setAge(int age) {
      this.age = age;
      }

      //@Pattern(regex="^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,4}$")
      @NotNull
      @Email
      public String getEmail() {
      return email;
      }

      public void setEmail(String email) {
      this.email = email;
      }
      in the web page, used with jseam validate. strangely, the @Email,@Pattern,@Range all work fine, but the @NotNull always refused to work - empty form can be submitted . I have tried @NotEmpty, it's the same with @NotNull.
      Can anyone help me?
      I use jseam2.1.1 , jboss As 5 and the DB is Hypersonic
      Thanks.