struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RogerV <roger.var...@googlemail.com>
Subject Re: Struts 2 Conditional Validators?
Date Thu, 16 Dec 2010 12:24:46 GMT



Dave Newton-6 wrote:
> 
> Validators aren't called when *you* call a method, its not like they
> cause byte-code to be inserted.
> 
> Dave
> 

Ok - bad choice of words. Validation annotations are processed by the
AnnotationValidationInterceptor. How it decides what to process I find a bit
hazy. There is super class ValidationInterceptor call made
actionValidatorManager.validate(action, context, method); 
which I assumed meant that the interceptor was looking to process only those
annotations on the method being called, rather than looking for all the
annotations in the class and applying them in turn (which is what the
VistorValidator seems to do unfortunately). I kind lost it at this point as
Struts found and executed my annotations although they were on methods
called by execute() rather than being placed on execute() itself.

Regards

Regards
-- 
View this message in context: http://old.nabble.com/Struts-2-Conditional-Validators--tp30471468p30472121.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message