Hi, my action has a field that is in type of User:
User user;
public User getUser() {return user;}
public void setUser(User user) {this.user = user;}
And the following is a validation rule for it using XML file (Assume
the User class has 'email' field.):
<field name="user.email">
<field-validator type="requiredstring" short-circuit="true">
<message key="email.required"/>
</field-validator>
<field-validator type="email">
<message key="email.invalid"/>
</field-validator>
</field>
It worked fine. And now, I am trying to use annotations. However, I
have no idea to specify @EmailValidator to the 'user' field in the
action. The following did not work:
User user;
public User getUser() {return user;}
@EmailValidator(type = ValidatorType.FIELD,
fieldName = "user.email", key = "email.invalid",
message = "Invalid mail addrss")
public void setUser(User user) {this.user = user;}
I noticed that using @Validations, I can specify the @EmailValidation
as a validation rule for whole class but the speicif field. But I
cannot specify short-circuit in @Validations.
Any idea?
--
Ruimo Uno
(Shisei Hanai)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]