This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Is execute() method always executed? (Struts 1) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is execute() method always executed? (Struts 1)" Watch "Is execute() method always executed? (Struts 1)" New topic
Author

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

Swerrgy Smith
Ranch Hand

Joined: Mar 26, 2010
Posts: 88
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

Joined: Sep 29, 2008
Posts: 12617

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! :)
 
Don't get me started about those stupid light bulbs.
 
subject: Is execute() method always executed? (Struts 1)
 
Similar Threads
problem log out
Struts handle first request.
global forwards to DispatchAction not working?
how to call a specific action
struts1.1 and tomcat 5.5.27