Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

January 9, 2011

Servlet load-on-startup

The value of the tag load-on-startup helps the container determine when the servlet has to be loaded.

A value >=0 means that the servlet has to be loaded when the application is deployed.

If the value is less than zero or if the tag element is not present, the servlet will be loaded when it is first called.

Also, the order in which servlets are loaded is determined by the value of load-on-startup. The servlet which has a lower load-on-startup value will be loaded first. e.g the servlet with value 2 will be loaded before the servlet with this value as 4.

Apart from this, if two servlets have same value of load-on-startup, then they are loaded in the order in which they are defined in the Deployment descriptor file.

No comments: