REGISTER FREE to Receive Instant Job

Tuesday, 23 October 2012

Life cycle methods of Servlet

  • init() method is invoked only once just after a Servlet object is created. It is used by the server to provide the reference of an object of type ServletConfig to the servlet. ServletConfig is an interface of Servlet API, implementation of which is provided by Server Vendor.    
  • example : public void init(ServletConfig config);
  • service() method is invoked by the server each time a request for the servlet is received. It is used by the Application Developer for processing request. 
  • example : public void service (ServletRequest request, ServletResponse response) throws ServletException, IOException;
  • destroy() method is invoked only once just before a servlet is unloaded.
    example : public void destroy();

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.

About Me

My photo

JobsAcid is a 'job search engine' to provide finding a job on the internet easier for the user. It has designed as huge selection of job offerings on the same search engine.