• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Flow of Execution with no form

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ALL,
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ...

thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic