what is the purpose of load_on_startup entry in struts-
config.xml?

Answer Posted / dinesh/bangalore/india

Details about load on startup (load-on-startup tag) in
Servlet:
Used to decide whether servlet will be " lazily " or "
eagerly " loaded
Specified in web.xml file

If the value is not specified or is a Number < 0 then it
means " lazy loading "

What " lazy loading " means is that servlet is NOT loaded
by container on startup

Servlet in this case is loaded on the first client request -
so the first client can experience poor performance

" Eager " loading means that the servlet is initialised on
container startup

If there are two servelts A & B with values 0 & 1 than it
means that Servlet A ( having value = 0 ) will be loaded
first

So if there are more than one servlet this element
specifies the order of loading - lower integer values (
including zero ) are loaded first

If you specify this element but do not provide the value -
even then the servlet will be the first servlet that gets
loaded

To ensure that servlet follows " lazy loading " - do not
provide this entry at all in web.xml file OR provide a
negative number.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps used to setup dispatch action?

492


What is DynaActionForm?

595


What do you mean by tiles in struts?

532


Explain the difference between dispatchaction and lookupdispatchaction in struts?

2030


What are result types in struts?

563






How can we get Servlet API Request, Response, HttpSession etc Objects in action classes?

622


What configuration changes are required to use Tiles in Struts?

563


What is controller in struts ?

526


Why struts 1 classes are not thread safe whereas struts 2 classes are thread safe?

495


What is the purpose of struts.properties in struct2?

523


How are interceptors and servlet filters different?

478


What’s the difference between struts and espresso?

496


Explain the difference between jakarta struts and apache struts?

517


What configurations are stored in struts configuration file ?

530


What is request processor and how does it relates to action mapping?

573