• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding load-on-startup

 
kir kum
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
What is the significance of using load-on-startup in servlets. Which values can be used for that.

Regards
Kiran
 
Chetan Raju
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servers/Web-containers sometime use a method called as lazy loading. Only when the request comes for the servlet does the container initializes the servlet. If you put load-on-startup value as 1, the container loads and initializes the servlet on container startup.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A value of 1 signifies that this servlet should be loaded first, and then the servlets with values 2, 3, ... in that order.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SRV.13.4 #10 in the servlet spec explains this pretty well
There is a link to the servlet spec in my signature.

You may also want to read up on (the newer) ServletContextListener as it is a better alternative for doing most of what used to be done with the load-on-startup mechanism.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!