You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Zepernick <Pa...@healthsmart.com.INVALID> on 2020/12/07 14:16:51 UTC

Opting action method back into validation

Is there any way to take a method that has been excluded from validation in the configuration and turn it back on for a single action?  For example, I am using the REST plugin which excludes the show() method from the validation.  99% of the time I do not have any validation that I want to run, but I do have some edge cases where it would be helpful to have the validate() / validateShow() available for a particular action.


Paul R Zepernick | Sr Programmer Analyst
HealthSmart
paul.zepernick@healthsmart.com | www.HealthSmart.com<http://www.healthsmart.com/>

[HS email footer]<http://www.healthsmart.com/>   [if_square-linkedin_317725 (3)] <http://www.linkedin.com/company/healthsmart>   [if_square-twitter_317723 (3)] <http://twitter.com/healthsmart>   [if_square-facebook_317727 (2)] <http://www.facebook.com/healthsmart>

Disclaimer: This communication and any files transmitted with it may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is strictly prohibited. If you received this communication in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.

Re: Opting action method back into validation

Posted by Lukasz Lenart <lu...@apache.org>.
wt., 8 gru 2020 o 12:39 Paul Zepernick
<Pa...@healthsmart.com.invalid> napisał(a):
>
> It is an existing project that has hundreds of action classes and is currently configured by the struts rest plug-in to ignore the show method for validation.  I know I can update the configuration to remove the exclusion, but many of these actions also have a validate() implementation which would begin to fire for the existing show().  I would have to go through and add the skip validation annotation on most of these.

I see, the only option for now is to override
"AnnotationValidationInterceptor" and implement your own check


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: Opting action method back into validation

Posted by Paul Zepernick <Pa...@healthsmart.com.INVALID>.
It is an existing project that has hundreds of action classes and is currently configured by the struts rest plug-in to ignore the show method for validation.  I know I can update the configuration to remove the exclusion, but many of these actions also have a validate() implementation which would begin to fire for the existing show().  I would have to go through and add the skip validation annotation on most of these.

I was wondering if there was a way to configure the validation for a specific action class which would force the validation to run?  For example, a @doValidation annotation on the method that overrides the exclusion in the config.

Paul Zepernick
Sent from my iPhone

> On Dec 8, 2020, at 2:13 AM, Lukasz Lenart <lu...@apache.org> wrote:
>
> NOTICE: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> pon., 7 gru 2020 o 15:24 Paul Zepernick
> <Pa...@healthsmart.com.invalid> napisał(a):
>
>> Is there any way to take a method that has been excluded from validation
>> in the configuration and turn it back on for a single action?  For example,
>> I am using the REST plugin which excludes the show() method from the
>> validation.  99% of the time I do not have any validation that I want to
>> run, but I do have some edge cases where it would be helpful to have the
>> validate() / validateShow() available for a particular action.
>>
>
> Not sure if I understand, you can add your conditional validation logic
> into "validateShow()", so in 99% this method will do nothing, but in 1% of
> conditions it will perform the validation.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.lenart.org.pl%2F&amp;data=04%7C01%7CPaul.Zepernick%40healthsmart.com%7C7a2e901f7b1a4606382d08d89b48b90a%7C2ce547c5e80a40628a56f25adceefb52%7C0%7C0%7C637430083954665096%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=3QNfekKTv9TaGv%2BvrsY0f%2Baf9CedsOALl5%2BVXb6qUAY%3D&amp;reserved=0
Disclaimer: This communication and any files transmitted with it may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is strictly prohibited. If you received this communication in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.

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

Re: Opting action method back into validation

Posted by Lukasz Lenart <lu...@apache.org>.
pon., 7 gru 2020 o 15:24 Paul Zepernick
<Pa...@healthsmart.com.invalid> napisał(a):

> Is there any way to take a method that has been excluded from validation
> in the configuration and turn it back on for a single action?  For example,
> I am using the REST plugin which excludes the show() method from the
> validation.  99% of the time I do not have any validation that I want to
> run, but I do have some edge cases where it would be helpful to have the
> validate() / validateShow() available for a particular action.
>

Not sure if I understand, you can add your conditional validation logic
into "validateShow()", so in 99% this method will do nothing, but in 1% of
conditions it will perform the validation.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/