Show TOC Start of Content Area

Background documentation Servlet Life-cycle  Locate the document in its SAP Library structure

Java Servlet 2.3 Specification defines the life cycle of servlets as components of a Web application. It is entirely managed by the Web Container in which the servlet is deployed. The life cycle consists of the following phases:

...

       1.      Loading the servlet class – this is done when the Web application is started.

       2.      Creating an instance of the servlet class – if the servlet is declared in the Web application deployment descriptor, it is instantiated at application startup time. If it is not declared, instantiation is done when the first request to the servlet arrives.

       3.      Initializing the servlet instance – the Web Container calls the init method of the servlet when the first request to the servlet arrives, or when the Web application is started (depending on whether or not you have declared the servlet in the Web application deployment descriptor).

       4.      Servicing client requests – the Web Container calls the service method of the servlet and executes whatever logic is programmed.

       5.      Removing the servlet of service – the container calls the destroy method of the servlet.

 

 

End of Content Area