• By default, the servlet instance will be created when the first client sends a request to the servlet.
• Only one instance will be created for one servlet and will be used to process all the requests by using multiple threads.
• If you want to create the instance while starting the server or container, you can use the following:
o In web.xml
<servlet>
….
<load-on-startup>X</load-on-startup>
</servlet>
o In Annotations
@WebServlet(….,loadOnStartup=x)
• Note: X will be an int type value. It should not be a negative integer.
• It indicates in which order the servlet instance will be created.