Servlet Lifecycle

What is the Lifecycle of a Servlet?

Questions by Darsh_singh

Showing Answers 1 - 3 of 3 Answers

The life cycle of a servlet is controlled by the container in which the
servlet has been deployed. When a request is mapped to a servlet, the container
performs the following steps.


Loads the servlet class.
Creates an instance of the servlet class.
Initializes the servlet instance by calling the init method.


If an instance of the servlet does not exist, the Web container


Invokes the service method, passing a request and response object.


If the container needs to remove the servlet, it finalizes the servlet by
calling the servlet's destroy method


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions