What is Struts Flow?

Answer Posted / hemanthkumar

while making a call to index.jsp page straight
away request is not going to the ActionServlet, request is
going to the jsp page. Jsp page is giving output to the
browser. If request is not going to the ActionServlet Struts
framework is not at all involving.
Inside jsp page we have one <html:form> tag is
there. under <html:form> tag all custom tags are involving.
From this Custom tags all sequential methods can be
executed. After that it can execute action attribute, if
action attribute is .do request then it is mapped with
url-pattern of xml file.
while startup am application, ActionServlet
init() will be called because of load-on-startup tag in xml
file.
Struts developers developed ActionServlet and
kept inside struts.jar file.
While starting an application, ActionServlet
object got created and init() will be called. Inside body of
init(), it knows what is the config file and loads complete
content of the configuration file, and stored into the
ModuleConfig object.
Once app started conplete configuration can be
stored into the ModuleConfig object. It contains complete
configuration settings.
After that it will call init() of
RequestProcessor(RP) class. then the moduleconfig object is
going to the Rp.init().Now we have the availability of RP.
After that it will give a call to the form,
whenever we are calling form then formbean obj got created,
then it will look for scope, if scope is request then
formbean obj is stored into the request obj. All the getter
method's will be called for initialization purpose. Now,
once again it is going to the web.xml and call the
ActionServlet. Inside ActionServlet , it will call either
doGet() or doPost(). From this doGet(), it will call the
process() of RequestProcessor. Inside process(), it will
call processPreProcess().
If processPreprocess() returns false, the program
will be terminated.
If it returns true, then it will initialize the
ActionMapping object and call the validate().
If validate() returns error obj, then it will go to
the particular input field and display the errors. Otherwise
Action class object got initialized then execute() will be
called and execute the business logic. Finally interact with
the database....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between jakarta struts and apache struts?

531


Can you explain custom tag?

575


How we can install struts?

558


What is the naming convention for a resource bundle file in struts2?

541


What is controller in struts2?

504






Why use spring, if you are already using struts?

562


Does apache struts run on windows?

537


What do you mean by tiles in struts?

545


Which tag is used to declare constants in struts xml?

476


Explain struts?

559


What are the core components of a struct2 based application?

564


What is action support class in struts2?

570


Describe validate() and reset() methods.

608


How many instances of servlet usually run in a struts application ?

544


What is the use of jsonvalidation in struts?

556