When servlet will be initialized?

Servlet will be initialized at container start up when you write <load-on-startup> tag.
When you are writing <load-on-startup> tag then the servlet will be initialized when you send the first request to the server. 

2 comments :

  1. Pls explain in proper way.
    It creates confusion.

    ReplyDelete
  2. Actually, Web container initialized the servlet before response to the client request and after loads and instantiates the servlet class.

    ReplyDelete