Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts Flow of Execution with no form

Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was going through struts flow and i got how it works when a form is submitted .But then i saw few struts application in which no forms were present and jsp page simply forwards the request to the one action like this .
Eg :

Even though form is not there,action is mapped to one form bean class in the action mapping tag in struts-config.xml:

values for the form bean class was populated in Execute method of Action Subclass using setter method of form bean class like this :

now normally if form is there ,
(i)RequestProcessor identifies the Action class and it checks the whether the request is associated with any form bean.This can be checked by using the name attribute of the action element from the struts-config.xml.
(ii)The RequestProcessor instantiates the UserForm and puts it in appropriate scope either session or request and iterates through the HTTP request parameters and populates the CustomerForm properties of the same.
(iii)Next, the RequestProcessor checks for the validate attribute in the ActionMapping.If any error then it checks for the input attribute in the ActionMapping and forward to page mentioned in the input tag.If no error in validate() method then continue.
(iv)The RequestProcessor instantiates the Action class specified in the ActionMapping (UserAction) and invokes the execute() method .

so in the above application ,

(i) in which order instances will be created ?
(ii)what is exactly the flow [if there is any change ]?

i've this doubt because ,here form bean class is populated in execute method only ,which is not the case when form is present ... so what is exactly happening here ?

thanks ...
karthik chellappan
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,

if anyone could tell what is happening in the above example ,it would be of great help to clear my concept ...

Dinner will be steamed monkey heads with a side of tiny ads.
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic