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 difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

618


What is the servlet?

620


What is servlet and its use?

627


What are the features added in Servlet 2.5?

768


What is difference between jsp and servlet?

644






Where do you define dispatcherservlet?

552


What is the difference between servlet and filter?

528


What are the steps that are involved in using the httpservlet class?

572


What are the phases of servlet life cycle?

607


what is multiple server?

1758


Why do we have servlet listeners?

597


Explain the servlet context.

602


Is servlet a controller?

573


How do you find out what client machine is making a request to your servlet

529


How does tomcat servlet container work?

592