Thank you for your information. I have got xwork-2.0.3 and took diff
against 2.0.1 in directory
'src/java/com/opensymphony/xwork2/validator/annotations'. It seems
that the only change is just removing StringRegexValidator. Sounds
like I should wait until 2.1 release.

2007/6/13, Jeromy Evans <[EMAIL PROTECTED]>:
   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?
>
In 2.0.6 the annotation validation has a lot of limitations compared to
the xml version.  For a start it doesn't work with multiple action
methods properly, I'm fairly sure it can't be used with the DWR ajax
validator and I'm fairly sure you can't use 'fieldName = "user.email" on
a User property.  I'm not 100% sure because I stopped bothering with it
as XML works just fine.

However, there's been many improvements to annotation validation in
xwork 2.0.2 and 2.1 in the last few months (see the issues at [1], maybe
yours is mentioned), and great improvements to ajax validation for
struts 2.1, so I don't know the status any more.  Struts 2.0.6 uses
xwork 2.0.1 but Struts 2.0.8 uses xwork 2.0.3.

In summary, it probably should work but doesn't, so maybe try Struts 2.0.8.

[1] http://jira.opensymphony.com/secure/Dashboard.jspa   (search for
annotation validation)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Ruimo Uno
(Shisei Hanai)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to