can i call destroy() method in init() method of servlet

Answer Posted / deepesh

Yes, We can call destroy() from init() method but after
coming out from the destroy() it will again process the init
() method like the life cycle has to be. Thus we can not
control the servlet life cycle, though we can call destroy
() from init().

Thanks.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of Servlet over CGI?

662


What is servlet used for?

696


What do you mean by httpservlet?

563


What are the benefits of using servlet over cgi?

578


Explain web container.

567






What are the various ways of session supervision in servlets?

525


Why the concept of single thread model interface is used?

553


Which event is fired at the time of setting, getting or removing attribute from application scope?

613


Explain is servlet mapping?

580


What is the importance of init() method in Servlet ?

592


Explain servlet events?

563


explain the advantages of servlet life cycle?

557


What is ServletContext object?

643


Explain in brief the directory structure of a web application?

568


What are the differences between forward() method and sendredirect() methods?

547