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


Please Help Members By Posting Answers For Below Questions

How can link tag’s action attribute be used?

516


What is difference between spring and struts?

498


How do I access token?

489


Are struts still used?

509


Where can I get help with struts?

557






What are Struts2 core components?

550


What is dispatch action class?

603


How can duplicate form submission be handled in struts 2?

526


Which library is provided by struts for form elements like check boxes, text boxes etc?

502


What are the steps of struts installation?

563


Where should struts xml be placed?

496


How to explain Software Bank Loan descriptions

1893


Define struts?

616


Which configuration file is used for storing jsp configuration information in struts?

536


Who makes the struts?

538