The load-on-startup element indicates that a servlet should be loaded on the startup of the web application. This element can take an integer value which indicates the order in which the servlet should be loaded.
If the value is negative, or if this element is not present, the container is at its will as to when it should load the servlet. If the value is a positive integer or 0, the container must load and initialize the servlet when the application is deployed.
Generally the 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.
Hope this helps. Thanks, John
Do not let what you cannot do interfere with what you can do !!<br /> <br />SCJP & SCWCD 1.4
Joined: Aug 10, 2004
i am clear now. ok. iam using load-on-startup for a servlet the instance of the servlet will load when the server startup. i want to display my own first page when the server startup. can i use load-on-startup or any other alternate way. Pls any one tell me.
Joined: Apr 24, 2002
To display your own page, load-on-startup element cannot help you. You need to use the element "welcome-file-list" in which you can specify, as below, so that the server automatically serves you the page specified when the request comes for your webapp without speicifying the exact resource: <welcome-file-list> <welcome-file>my-own-page.html</welcome-file> </welcome-file-list>
So when the url "www.my-site.com/my-web-app" hits the server then the default page "my-own-page.html" gets served.