[s2] Validation 'magic' on 'input'

2007-02-12 Thread Laurie Harper
I'm trying to get validation working (using annotations) in a Struts2 project and I can't seem to get it to quite cooperate :-) I'm using the Zero Configuration and Code Behind plugins, so this may be a result of some unintended interaction between those and the validation framework. The use c

Re: [s2] Validation 'magic' on 'input'

2007-02-12 Thread Musachy Barroso
I think when you annotate a class with @Validations, "input" is the only method that will be called without invoking the validation first. musachy Laurie Harper wrote: I'm trying to get validation working (using annotations) in a Struts2 project and I can't seem to get it to quite cooperate :-

Re: [s2] Validation 'magic' on 'input'

2007-02-12 Thread Laurie Harper
Hmm, if that's true it'll mean I'm forced to split my user admin action into multiple actions (and same for every other master-detail view I have) :-( Does the same limitation apply when using XML-based validation? L. Musachy Barroso wrote: I think when you annotate a class with @Validations,

Re: [s2] Validation 'magic' on 'input'

2007-02-12 Thread Musachy Barroso
Wait until somebody else confirms it, as I'm not 100% sure :) musachy On 2/12/07, Laurie Harper <[EMAIL PROTECTED]> wrote: Hmm, if that's true it'll mean I'm forced to split my user admin action into multiple actions (and same for every other master-detail view I have) :-( Does the same limita

Re: [s2] Validation 'magic' on 'input'

2007-02-12 Thread Don Brown
Nah, there is a better way. Take a look at the struts-default.xml file and notice how the validation interceptor is configured to only skip validation on certain methods. Create a new base package that contains a default interceptor stack which has the validation interceptor configured different

Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Laurie Harper
Just to follow up on this for the archives, there is now an even easier way: annotate methods for which no validation should fire with @SkipValidation. I believe (?) that annotation is new with 2.0.6, or at least it's a recent addition. Anyway, it works very well. L. Don Brown wrote: Nah, th

Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Musachy Barroso
Is there any @SkipX annotation to skip populating a property by the ParamsInterceptor? musachy On 2/27/07, Laurie Harper <[EMAIL PROTECTED]> wrote: Just to follow up on this for the archives, there is now an even easier way: annotate methods for which no validation should fire with @SkipValida

Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Laurie Harper
Doesn't look like it, though I'd mostly want to apply such an annotation to properties I *don't* have, so I wouldn't get all those OGNL warnings logged with huge stack traces! ;-) Musachy Barroso wrote: Is there any @SkipX annotation to skip populating a property by the ParamsInterceptor? mus

Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Musachy Barroso
I could use it for security reasons, like populating an object model directly, but making sure that nobody sets the "id" property for example. I know I can do it using ParameterNameAware, but having an annotation would be nicer. musachy On 2/27/07, Laurie Harper <[EMAIL PROTECTED]> wrote: Does