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
Why use spring, if you are already using struts?
What is lookupdispatchaction?
What is validate() and reset() functions?
What is struts framework?
Where can I get a copy of struts?
What do you mean by the abstract package in struts2, and what is its utilization?
Give the details of xml files used in validator framework?
What is difference between actionform and dynaactionform?
What is the use of web xml in struts2?
how does request processor relates to action mapping?
What is struts and why it is used?
Why are frameworks used?
How are interceptors and servlet filters different?
What is used to display the intermediate result in an interceptor?
in struts how to use hibernate with struts>