servlet life cycle?

Answer Posted / veeraiah dasari

Servlet lifecycle consists of three stages
1)generation
2)Service to the client
3)death of servlet
1)Generation:This stage occurs when a client request comes
to the server,it immediately generates a servlet for that
particular client by calling init() method.This method can
be called only once in a servlet life cycle.
2)Service :After servlet has been created,it provides the
service to the particular client by calling service() method.
This can be called many times in a servlet lifecycle.
3)death of servlet:In this after completion of the service
to the client.it is the responsibility of the server to
destroy the servlet by calling destroy() method.This method
can be called only once in servlet life cycle.

Is This Answer Correct ?    18 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the effective way to make sure all the servlets are accessible only when user has a valid session?

572


What's the servlet interface?

598


What are the different session tracking techniques?

684


What is the servlet?

625


Explain the difference between jsp and servlet?

592






When Servlet is unloaded?

629


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

619


How to read request headers from servlets?

565


Why is http protocol called as a stateless protocol?

537


What do you mean by web applications?

629


What is the difference between Server and Container?

622


Explain the architechure of a servlet?

605


Who is responsible for writing a constructor?

779


Whats the advantages using servlets over using CGI?

590


What is servlet instance?

544