This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes <load-on-startup> Tag in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "<load-on-startup> Tag in web.xml" Watch "<load-on-startup> Tag in web.xml" New topic
Author

<load-on-startup> Tag in web.xml

Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Hi All ,

Can anyone suggest what will happen if i am giving value 0 or negative or empty .What will be the loading sequence.



Have a great day.....


Thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

From the XML Schema description:
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
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Thanks Christopher ....Have a great day
 
jQuery in Action, 2nd edition
 
subject: <load-on-startup> Tag in web.xml