can i call init() method in destroy() method of servlset. ?

Answer Posted / gayathri janarthanam

One can programatically call destroy() from init(), though it is not recommended. it will be invoked like a regular java method call..Whatever code is written in the destroy method will run....It will not destroy the servlet...Only the servlet container can call the destroy() method to actually destroy a servlet....

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is servlet collaboration?

655


Can a jsp be called using a servlet?

578


Why is httpservlet declared abstract?

574


Define the life cycle of a servlets.

566


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

553






What is http servlet in java?

555


What are Servlets?

592


What are the advantages of Servlet over CGI?

661


What is servlet and list its types?

536


What is the disadvantage of cookies?

568


Explain the difference between servlet and cgi?

601


What do you mean by servlet?

711


Explain the jar and war files in servlet?

545


What is servletconfig?

541


What is servlet used for?

688