-->
(Absence of load-on-start-up) tag
First of all when ever servlet is deployed in the server, It is the responsibility of the server to creates the servlet object.
Eg: Suppose Servlet is deployed in the server ,(Servlet Object is not available in server) client sends the request to the servlet for the first time then server creates the servlet object with help of default constructor
and immediately calls init() . From that when ever client sends the request only service method will get executed as object is already available
If load-on-start-up tag is used in deployment descriptor:
At the time of deployment itself the server creates the servlet object for the servlets based on the positive value provided in between the tags. The Creation of objects for the servlet classes will follow from 0-128
0 number servlet will be created first and followed by other numbers.
If we provide same value for two servlets in web.xml then creation of objects will be done based on the position of classes in web.xml also varies from server to server.
If we provide negative value in between the load on start up tag then server wont create the servlet object.
Other Scenarios where server creates the object for servlet.
If we dont use load on start up tag in web.xml, then project is deployed when ever client sends the request for the first time server creates the object and server is responsible for calling its life cycle methods. Then if a .class is been modified in the server(tomcat).
again client sends the request for modified servlet but in case of tomcat new object will not created and server make use of existing object unless restart of server takes place.
But in class of web-logic when ever .class file is modified in the server with out restarting the server if it receives a request then server calls the destroy method on existing servlet and creates a new servlet object and calls init() for its initilization.