You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by akash agrawal <ak...@yahoo.co.uk> on 2008/03/06 01:20:30 UTC

validation excludeMethods version 2.0.11

Hi,

I am using validation framework and would like to disable validation for all the query methods like getA(), getB(), getC().

There is a excludeMethods property using which I can turn off validation for above methods by spelling out each method.

1. Is there a way to generalize this so that we don't need to spell out each getX method?

Any better ideas are welcome.

Thanks,
-Akash

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: validation excludeMethods version 2.0.11

Posted by Dave Newton <ne...@yahoo.com>.
--- akash agrawal <ak...@yahoo.co.uk> wrote:
> Thanks for the response.
> Could you give an example of how to use the approach you suggested?
> Here is my code:
> <interceptor-stack name="myStack">
>   <interceptor-ref name="defaultStack">
>     <param name="validation.excludeMethods">delete, getA, getB</param>
>   </interceptor-ref>
> </interceptor-stack>            

Oops, chalk another one up to my lack of sleep. I was confusing your question
with an earlier thread regarding the ParameterNameAware interface, which is
pretty far off the mark and not even remotely related.

Sorry.

That said, you could instead supply an "includeMethods" parameter which is a
whitelist of methods for which validation should be run: it's the opposite of
"excludeMethods" and may server you better in this case.

Dave


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


Re: validation excludeMethods version 2.0.11

Posted by akash agrawal <ak...@yahoo.co.uk>.
Dave,

Thanks for the response.
Could you give an example of how to use the approach you suggested?
Here is my code:
<interceptor-stack name="myStack">
  <interceptor-ref name="defaultStack">
    <param name="validation.excludeMethods">delete, getA, getB</param>
  </interceptor-ref>
</interceptor-stack>            

Thanks,

-Akash

Dave Newton <ne...@yahoo.com> wrote: --- akash agrawal  wrote:
> I am using validation framework and would like to disable validation for
> all the query methods like getA(), getB(), getC().
> 
> There is a excludeMethods property using which I can turn off validation
> for above methods by spelling out each method.
> 
> 1. Is there a way to generalize this so that we don't need to spell out
> each getX method?

Yeah. String's startWith method.

Dave


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



       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

Re: validation excludeMethods version 2.0.11

Posted by Dave Newton <ne...@yahoo.com>.
--- akash agrawal <ak...@yahoo.co.uk> wrote:
> I am using validation framework and would like to disable validation for
> all the query methods like getA(), getB(), getC().
> 
> There is a excludeMethods property using which I can turn off validation
> for above methods by spelling out each method.
> 
> 1. Is there a way to generalize this so that we don't need to spell out
> each getX method?

Yeah. String's startWith method.

Dave


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