servlet life cycle?

Answers were Sorted based on User's Feedback



servlet life cycle?..

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

servlet life cycle?..

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

servlet life cycle?..

Answer / giridhar gangapatnam

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

servlet life cycle?..

Answer / sanpar

the life cycle of the servlet:

Servlet class is loaded.
Servlet instance is created.
init method is invoked.
service method is invoked.
destroy method is invoked.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

Can you use javascript in servlets?

0 Answers  


Elucidate servlet attributes and its scope?

0 Answers  


can u give some realtime example in ploymorphism? and inheritance?

11 Answers   SolutionNET,


Why are servlets used?

0 Answers  


What is the difference between forward () and sendredirect () functions in servlet? Explain

0 Answers  






Explain Action Servlet?

0 Answers   Cap Gemini,


can we create more than ServletContext and ServletConfig in your application

6 Answers   Patni,


How ThreadSafe page attribute will be working in Servlet as well as in JSP?Automatically ThresdSafe is true in JSP so service method will be destroy in each and every request or not?so how thresd will handle srevice method?

1 Answers   AZTEC,


What is the difference between Difference between doGet() and doPost()?

0 Answers  


i have 500 jsp in my application ,with same forward name,it lokks for appropritae jsp from 1 to 500,but i want to send response to 498 page,what should i do

2 Answers   Caritor, Globerian,


What is the major difference between servlet and applet?

0 Answers  


What compiler do not do if we create our own constructor?

5 Answers   HCL,


Categories