• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

load on start up

 
ramchander yshetti
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
what is mean by

<load on start up>2</load on start up>

bye
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That indicates that this servlet should be loaded (i.e., instantiated and its init method called) at the startup of the web app. Normally a servlet is not instantiated until it is first called. But if the overhead of the instantiation is substantial, that would delay its reponse to the first request. So load-on-startup allows you to indicate that it should be loaded right when the web app is started.

The "2" indicates that this particular servlet should be the second one to load - there is probably another servlet with a load-on-startup with a "1"; that is loaded first, and then so on in ascending order.
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding to Ulf's reply.

Example of this kind of scenario is:

Struts ActionServlet. This needs to loaded first in an application(if application uses struts) because it takes some time to read configuration(struts-config.xml) file(s) and load it into memory.
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
load−on−startup element that tells the JSP/servlet container
that we want this servlet to be preloaded when the Web application starts. You must pre−load the ActionServlet, or your Struts Views will not load all of their necessary resources.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic