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 are its drawbacks of cgi?

764


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

734


If a servlet is not properly initialized, what exception may be thrown?

840


How servlets are deployed in java?

708


Can we use threads in Servlets?

825


How do we go with database connection and log4j integration in servlet?

890


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

759


What is the difference between portlet and servlet?

693


Explain web application directory arrangement?

773


Explain the war file?

801


If some new data has entered the database, explain how can a servlet refresh automatically?

969


What are the life cycle methods of the servlet?

790


Why do we have servlet filters?

767


What are Servlets?

810


How will you pass values from HTML page to the servlet?

752