Servlet Life Cycle consists of three methods:
- public void init(ServletConfig config) – This method is used by container to initialize the servlet, this method is invoked only once in the lifecycle of servlet.
- public void service(ServletRequest request, ServletResponse response) – This method is called once for every request, container can’t invoke service() method until unless init() method is executed.
- public void destroy() – This method is invoked once when servlet is unloaded from memory.
No comments:
Post a Comment