what is the purpose of load_on_startup entry in struts-
config.xml?
Answer Posted / srinu
If load_on_startup is not enabled in web.Xml then the
servlet crates the object that class and sevletConfig object
will be created after constructor will be executed after it
will go to life cycle methods in servlets.i.e means lot of
processing will be done when load-on-startup is not enabled.
If load_on_startup is enabled then that moment when
WEBAPPLICATION is deployed all lot of processing will be done.
Then immediately executes LIFECYCLE method in servlets
Problem: suppose our webapplication contain 10 servlets then
which servlet object will be created?
solution: for this problem If we use load on startup web
container creates the objects based on the proirity when
there are mutliple servlets.We use load_ on_ start up for
giving the proirity.
Note:1 is highest priorty
2 is next highest priorty
-1 ignores that value
EX:<load-on-startup>1</load-on-startup>
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
Why is action servlet a singleton in struts?
Describe the mvc on struts?
What is the purpose of @before?
What is the purpose of @doublerangefieldvalidator?
What is the difference in using Action interface and ActionSupport class for our action classes, which one you would prefer?
What is the use of web xml in struts2?
What is the purpose of constant tag in struts.xml?
What is strut web xml?
What is apache struts framework?
What is the purpose of '@customvalidator'?
Can you explain value stack?
Explain the life cycle of a request in struct2 application?
What is the purpose of @result?
What are the Core classes of Struts Framework?
What is lookupdispatchaction?