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 .
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 ?
posted 10 years ago
if anyone could tell what is happening in the above example ,it would be of great help to clear my concept ...
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