Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Struts Flow of Execution with no form

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic