Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

flow of control in struts

 
Vilpesh Mistry
Ranch Hand
Posts: 62
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

thanks.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic