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

Explain servlet events?

554


What is the use of servlet wrapper classes?

658


Why do we have servlet wrapper classes?

568


What is the difference between forward () and sendredirect () functions in servlet? Explain

538


What is the functionality of actionservlet and requestprocessor?

588






What do you mean by scope object and what are its types?

559


Explain in brief the directory structure of a web application?

559


What is servlet container?

659


Where do you define dispatcherservlet?

546


Explain get and post.

641


Describe the phases of servlet lifecycle?

621


What is the effective way to make sure all the servlets are accessible only when user has a valid session?

559


Difference between doget and dopost?

674


What do you mean by servlet context?

593


How do you create a cookie using servlet?

575