struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: VisitorFieldValidator - different validation scenarios
Date Fri, 19 Sep 2008 19:31:31 GMT
Gundersen, Richard wrote:
> Hi
> 
> I'm using the VisitorFieldValidator (annotations) to push validation
> over to my model object in my Action. 
> 
> However, I want the validation rules in my model object to work
> differently depending on which Action method is being called.
> 
> What's the best way of doing this please?

I don't think you can in that scenario. It might be possible to combine 
VisitorFieldValidator annotations with action/method specific rules (via 
annotation or XML), in which case you could set up your model 
validations to enforce invariants (e.g. required validation for 
properties that are always required, but not for those that are only 
required with certain methods) and use action or action/method level 
validations for the variant requirements. I haven't tried this, though, 
so unless someone who has can offer some advice, you'll have to 
experiment a bit to see what works.

L.


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


Mime
View raw message