It's not a secret anymore!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet life cycle" Watch "servlet life cycle" New topic
Author

servlet life cycle

in Mkumar
Greenhorn

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

Joined: Apr 14, 2004
Posts: 10336

Ahh the power of google .


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sagar Birari
Greenhorn

Joined: Sep 05, 2008
Posts: 11
visit to following links
http://www.allinterview.com/showanswers/4912.htmlhttp://www.roseindia.net/servlets/LifeCycleOfServlet.shtml

Regards


Sagar Birari
Development & Technical Blog
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3219
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 http://www.jguru.se/jguru/Channel_Html/generic/images/developers/servlet_lifecycle.gif


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
 
jQuery in Action, 2nd edition
 
subject: servlet life cycle
 
Similar Threads
What is the life cycle of Bean instances?
life cycle in different scopes
Threads
What is Software Development Life Cycle
Threads