This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes flow of control in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "flow of control in struts" Watch "flow of control in struts" New topic

flow of control in struts

Vilpesh Mistry
Ranch Hand

Joined: May 27, 2003
Posts: 62
hi all,
i always face this question on 'explain the step from submitting a form in Struts 1'

My Answer looks like:
1>Form gets submitted with the action tag containing '/xyz' as value.
2>ActionServlet gets the request and checks for path in struts-config.xml, actionmapping's action's path attribute.
3>Suppose an action containing path as '/xyz' is found then its actionForm indicated by the 'name' attribute is instantiated.
4>ActionForm checks for the form fields if the 'validate' attribute is true.
If validation fails, then 'input' attribute denotes the jsp to be invoked and displayed to user.If validation passes then Action Class is called.
5>Control enters into the extended Action class, execute method.
6>Buisness logic is executed and Errors object filled in accordingly.
7>ActionMapping findForward gets called and proper forward is returned.

Are these steps correct, as i understand as these to be correct steps in Struts Flow.


Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Looks pretty good but I would add some clarification.

1) You say "action tag" but at the point where the page is shown in the browser there is no such thing as an action tag. The page was rendered as html. The html page has a form tag with an action attribute that references your Struts action. It would also be important to mention that all the input fields on the form are submitted as part of the request as well.

3) It seems important to mention that the form is populated with values submitted on the request.

- Brent
It is sorta covered in the JavaRanch Style Guide.
subject: flow of control in struts