Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet life cycle

 
in Mkumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is life cycle of servlets.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh the power of google .
 
Sagar Birari
Greenhorn
Posts: 11
 
arulk pillai
Author
Ranch Hand
Posts: 3385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic