Explain the life cycle of a Servlet.

Technology CommunityCategory: JavaExplain the life cycle of a Servlet.
VietMX Staff asked 3 years ago

On every client’s request, the Servlet Engine loads the servlets and invokes its init methods, in order for the servlet to be initialized. Then, the Servlet object handles all subsequent requests coming from that client, by invoking the service method for each request separately. Finally, the servlet is removed by calling the server’s destroy method.