Monday, 27 June 2016

How and when life cycle methods are invoked ?


Servlet interface provide life-cycle methods.

1. init() : The servlet is constructed, and then initialized with the init method.
2. service() : Any calls from clients to the service method are handled.
3. destroy() : The servlet is taken out of service, then destroyed with the destroy method.
    Then garbage collected and finalized.

It also provides :
4. getServletConfig() : used to get any startup information
5. getServletInfo() : allows the servlet to return basic information like, author, version, and copyright

No comments:

Post a Comment

Note: only a member of this blog may post a comment.