Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Swerrgy Smith
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • 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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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! :)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic