Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to set alwaysInvokeValidate globally to false (S2)

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to set alwaysInvokeValidate to false globally because I don't want write this to all action separatly.

<interceptor-ref name="workflow">
<param name="alwaysInvokeValidate">false</param>
</interceptor-ref>



In other words - I need set up Struts 2 default configuration to another value.

Thanks.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Define your own interceptor stack, set the parameter, and use that stack as the default stack.
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Dave for your response, but this didn't solve my problem.

This is description of my problem:

I have one class named BaseClass, which has method validate(). Next have another one class named SubClass, which extends BaseClass. There have method validate, too, which overrides inherited method validate from BaseClass:



In class SubClass have two methods - accept and decline. I want apply validation only on method accept. Therefore I made method



I hoped, if I good understand to set variable alwaysInvokeValidate to false, that method validate will be called only if I will not have method validate{MyMethodName}()...

But I set alwaysInvokeValidate to false and validate method is still called when I call method decline.

I use anotation @SkipValidation on method decline, too.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh; I think I misunderstood what you meant.

Hmm; I would have thought that would work. Which version of S2 are you using?
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using 2.0.14 version of Struts.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic