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

Answers were Sorted based on User's Feedback



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

Answer / srinivasa

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.

Is This Answer Correct ?    12 Yes 2 No

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

Answer / priyanka bhattacharyya


If the struts configuration objects were to be created on
the first call from the user it will adversely affect
performance by delaying response for the first user.

By specifying load-on-startup = 1 we tell the servlet
container to call the init() method immediately on start up
of the servlet container.

Is This Answer Correct ?    12 Yes 5 No

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

Answer / 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

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

Answer / anjani kumar jha

load_on_startup only shows the priority of the class loading
when u start ur web server in any web apps.

1----hightest prioritty
<load-on-startup>1</load-on-startup>

Is This Answer Correct ?    4 Yes 2 No

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

Answer / sekhar babu

If we are using any of the custom tags related to struts
like <html:form> etc, then it compulsory we need the tag of
<load-on-startup> in web.xml then only we will get the
output of corresponding jsp on to the browse or else we will
get the some errors like ActionMapping cannot resolve...

Is This Answer Correct ?    4 Yes 2 No

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

Answer / sulaiman harith

When we need to get the servelt object initialized before
the request is sent by the user.Usually servlet object will
get initialized soonafter the client send a request.Servlet
init() will get called once, to get the servlet object.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / jagadish

The load-on-startup element indicates that this
servlet should be loaded (instantiated and have
its init() called) on the startup of the web
application. The optional contents of these
element must be an integer indicating the order in
which the servlet should be loaded. If the value
is a negative integer, or the element is not
present, the container is free to load the servlet
whenever it chooses. If the value is a positive
integer or 0, the container must load and
initialize the servlet as the application is
deployed. The container must guarantee that
servlets marked with lower integers are loaded
before servlets marked with higher integers. The
container may choose the order of loading of
servlets with the same load-on-start-up value.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / srinivasa

To create the servlet objects when the web application is
started.

In Case of Struts Action servlet object is created when the
application is started on proirity basis.We can specify
some integer value for this in such cases servlets will be
created on priority basis . Low value servlet will be
created fisrt...

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Struts Interview Questions

Is Struts Action class Thread Safe?

14 Answers   Wipro,


how you implement and maintain your struts project by using MVC2 arch?

2 Answers   Patni, Wipro,


What is the difference between session scope and request scope when saving formbean ?

0 Answers  


What are the cons of struts 2?

0 Answers  


What is dispatch action class?

0 Answers  






Explain the complete struts validator framework.

0 Answers  


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

0 Answers  


In web.xml file instead of *.do can i write *.ibm, Specify with example

13 Answers   IBM,


What is struts 2 framework in java?

0 Answers  


What is the use of jsonvalidation in struts?

0 Answers  


What are the components of struts?

0 Answers  


What is struts?

0 Answers  


Categories