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

How to find whether a parameter exists in the request object?

673


How can you run a servlet program?

610


Explain how to improve Servlet Performance?

604


What do you mean by default initialization in java servlet?

613


What is cookie? Why is cookie used?

594






What is difference between get and post method?

581


What do you mean by a filter and how does it work?

547


Explain mvc pattern.

598


What is servlet attributes and their scope?

600


Define declaration.

626


When should you prefer to use doget() over dopost()?

673


Explain the difference between generic servlet and http servlet?

545


What is the purpose of dispatcherservlet properties?

522


What is a servlet context object?

630


What is the difference between context parameter and context attribute?

539