[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - @NotNull validator doesn't work
zzuli
do-not-reply at jboss.com
Tue Feb 24 23:58:02 EST 2009
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, at Pattern, at 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.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212807#4212807
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212807
More information about the jboss-user
mailing list