Show TOC

Background documentationDestroying Servlet Instances Locate this document in the navigation structure

 

Servlets are removed from the service by the Web Container calling their destroy() method. This releases the instance of the servlet. There are different reasons for a servlet to be finalized - the application is about to be stopped, the servlet has thrown unavailable exception and so on.

The Web Container provides a timeout period before it actually calls the destroy() method of the servlet. This gives any long-running threads executing the service method of the servlet the opportunity to complete their work. The timeout is specified using the DestroyTimeOut property of the Web Container Service.