servlet life cycle?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / rajshri
servlet life cycle..
1) loading of class
2) instantiation of that loading class
3) call init() method
4) call service() method
5) call destroy() method
| Is This Answer Correct ? | 9 Yes | 0 No |
Life Cycle of Servlet:
1.Servlet Loading.
2.Servlet instantiation:
After Servlet instantiation and before calling init() method
ServletConfig object is created by Container.
3.Servlet initialization: At that time init() method is called.
4.Request processing:In this stage service() method is called
and at that time Request and Response objects are created by
Container.
5.Servlet deinstantiation:At this stage destroy() method
will be called.
| Is This Answer Correct ? | 2 Yes | 0 No |
What is ServletContext() and what is its use?
9 Answers Prime Technology, TCS,
Can we refresh servlet in client and server side automatically?
How to get the IP address of client in servlet?
Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?
What is servlet and its life cycle?
What is servlet name in web xml?
What is the difference between the servlets and cgi programs?
What is the servlet?
What does the term localization refer to?
Can you call a jsp from the servlet?
What is pure servlet?
Can we get PrintWriter and ServletOutputStream both in a servlet?