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

Why use spring, if you are already using struts?

562


What is strut action mapping?

517


Which file is used by controller to get mapping information for request routing?

539


Which interceptor is responsible for file upload support?

581


Does apache tomcat use struts?

512






What is a custom tag?

549


What types of validations are available in xml based validation in struts2?

556


What is difference between lookupdispatchaction and dispatchaction?

633


What is the use of namespace in action mapping in Struts2?

578


What is the purpose of @requiredstringvalidator?

564


What is the actionform?

580


What is the purpose of @after?

589


What are the sections into which a strut configuration file can be divided?

558


Explain about struts relation to html tags?

556


Describe validate() and reset() methods.

608