• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is execute() method always executed? (Struts 1)

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I know that we can configure in struts-config.xml so that when we click in an URL, a specific method in action class will be executed instead of the default execute() method. However, I would like to know if the execute() method is always executed before that specific method?

For example, if we have a configuration like below:


When we click in an URL with the parameter method=specificMethod, I know that the specificMethod() will be executed. But whether the execute() method is executed before this specific method is invoked()?

Thank you very much.
 
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
Yes--that's how it finds the method to call. The DispatchActions override execute(), read the parameter, and call the appropriate method.

Sometimes it's quicker to just check the source code first--one of the advantages of an open-source project is that you don't have to wait for answers! :)
 
Goodbye moon men. Hello tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic