It seems to me I've found the solution:
Add this to your action declaration:
<interceptor-ref name="defaultStack">
<param name="validation.validateAnnotatedMethodOnly">true</param>
<param name="includeMethods">actionMethodHere</param>
</interceptor-ref>
Have fun! :)
- Thilo
This works for me, but
Am 04.12.2007 um 13:24 schrieb Martin Gilday:
I posted about this a while back. Nobody seemed to have an annotation
based solution, only going back to XML.
----- Original message -----
From: "Thilo Ettelt" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Date: Tue, 4 Dec 2007 13:01:15 +0100
Subject: [s2] Different Annotated Validations for different action
methods
Hey all,
I'm trying to figure out how to validate my action methods
differently.
For example I've got a modeldriven User bean with the following two
annotated methods
@Validations(...)
- processLogin
@Validations(...)
- processSignup
Now I want the first annotation to only check for the username and
password, but the second annotation is supposed to check for other
things like email too.
However when I call the appropriate action mapping which calls
processSignup it processes both Validations, which results in a
invalid email address error for the login in addition to the wrong
username and password.
So how can I separate the two validatio annotations without needing
separate classes?
- Thilo
--
Mit freundlichen Grüßen,
Thilo Ettelt Telefon: +49-421-6265-111
Carmunity.com GmbH Telefax: +49-421-6265-100
Mary-Astell-Strasse 2 E-Mail: [EMAIL PROTECTED]
28359 Bremen http://www.carmunity.de/
Developer (YourVids)
Handelsregisternummer: HRB 19256 beim AG Bremen
Geschäftsführer:
Dipl.-Wirt.-Ing. W. Schlösser
Dipl-Ing. Frank Rothgänger
Bennet Bock
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mit freundlichen Grüßen,
Thilo Ettelt Telefon: +49-421-6265-111
Carmunity.com GmbH Telefax: +49-421-6265-100
Mary-Astell-Strasse 2 E-Mail: [EMAIL PROTECTED]
28359 Bremen http://www.carmunity.de/
Developer (YourVids)
Handelsregisternummer: HRB 19256 beim AG Bremen
Geschäftsführer:
Dipl.-Wirt.-Ing. W. Schlösser
Dipl-Ing. Frank Rothgänger
Bennet Bock
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]