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
What is the life cycle of actionform?
What is the use of reset method of ActionForm class?
What is value stack?
Who makes the struts?
Does apache tomcat use struts?
Explain struts?
How many action classes can be used in struts application?
What is the purpose of global-forwards tag in struct-config.xml?
How to get data from the velocity page in a action class?
How we can controlled duplicate form submission in struts?
What is an interceptor stack?
What are the life cycle methods of interceptor?
What is controller in struts ?
What is the purpose of '@customvalidator'?
Explain integrate log4j in struts2 application?