This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlet life cycle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet life cycle" Watch "servlet life cycle" New topic

servlet life cycle

in Mkumar

Joined: Sep 08, 2008
Posts: 20
what is life cycle of servlets.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Ahh the power of google .

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sagar Birari

Joined: Sep 05, 2008
Posts: 11
visit to following links


Sagar Birari
Development & Technical Blog
arulk pillai
Ranch Hand

Joined: May 31, 2007
Posts: 3371
The Web container is responsible for managing the servlet�s life cycle. The Web container creates an instance of the servlet and then the container calls the init() method. At the completion of the init() method the servlet is in ready state to service requests from clients. The container calls the servlet�s service() method for handling each request by spawning a new thread for each request from the Web container�s thread pool. Before destroying the instance the container will call the destroy() method. After destroy() the servlet becomes the potential candidate for garbage collection.

State chart diagram

[] | [Java job hunting know how] | [Java resumes]
subject: servlet life cycle
It's not a secret anymore!