Ciclo de vida de um SERVLET

Categoria: Java para WEB
Publicado em 28 de Novembro de 2010

Servlets are normal Java classes which are created when needed and destroyed when not needed. Since Servlets run within a Servlet Container, creation and destruction of Servlets is the duty of Servlet Container and not yours. Implementing the init() and destory() methods of Servlet interface allows you to be told by the Servlet Container that when it has created an instance of your Servlet and when it has destroyed that instance. An important point to remember is that your Servlet is not created and destroyed for every request it receives, rather it is created and kept in memory where requests are forwarded to it and your Servlet then generates response.

Extract from: http://www.stardeveloper.com/articles/display.html?article=2001061901&page=1

 

Copyright © Fernando Hidemi Uchiyama 2010 - Todos os direitos reservados