File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

load-on-startup

 
Deepak Jain
Ranch Hand
Posts: 637
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. If the value is a positive 128 integer or 0, the container must load and
initialize the servlet as the application is deployed.

If +ve integer or 0 then the load the servlet after the container startsup.

From HFServlets & JSP 1 st edition : Page 596 [3rd para] : In other words any value greater than zero means load early.

Who is correct?
I tested and found a zero value of <load-on-startup> causes the early load of the servlet [ or JSP generated servlet i.e, init() or jspInit() is invoked]
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who is correct?

The specification is correct. And it says :
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.
 
Praveen Kumar
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is -ve or value is not there means container should load when ever request for the servlet. The value may be 0 or pisitive ( between
0 to 128). Always lower values will choose first and if you have same value , then order matters in DD means first(earlier) will be choosen.



Thanks
Praveen
SCWCD Preparing
 
Deepak Jain
Ranch Hand
Posts: 637
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFS requires a errata if its not there already.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic