File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes load-on-startup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "load-on-startup" Watch "load-on-startup" New topic
Author

load-on-startup

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
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]


SCJP, SCWCD, SCBCD
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
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

Joined: Aug 05, 2006
Posts: 637
HFS requires a errata if its not there already.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: load-on-startup