In which cases Destroy() is invoked?

Answer Posted / shakir khan

When server wants to remove the servlet from pool,it will
execute the destroy().

destroy() is invoked,when servlet is unloaded from
memory.This is a good place to clean up any resources(Such
as open files or database connections).

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s the difference between sendredirect and forward methods

659


Which interface should be implemented by all servlets?

806


What is the difference between Servlets and Applets?

628


How do you load an image in a Servlet?

758


How do you communicate in between Applets and Servlets?

696






Why servlet is mostly used?

827


Given the request path below, which are context path, servlet path and path info?

633


What are the different types of servlets?

595


What do you mean by session tracking?

766


What is meant by a servlet?

690


Should I override the service() method?

749


What is called Session Tracking?

684


What is a servlet context object?

712


What are the uses of servlet

709


What is servlet and its types?

647