Tuesday, November 29, 2011

Can we call destroy() method on servlets from service method?

Destroy() is a servlet life-cycle method called by servlet container to kill the instance of the servlet. :! According to servlet specification there is no need to call destroy method. But we can call destroy() method in our service() method, when we call destroy() method it will not destroy the servlet object.Typically it will unreferences the ServletConfig object. If our code try to use it at that time our servlet will fail.
Category:Servlet Interview Questions

No comments:

Post a Comment