• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

flow of control in struts

 
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.
 
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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic