Can we call destroy() method inside the init() method? What
happens when we do so?

Answer Posted / ashwin kumar j

Yes you can call a destroy() method in init() method, but
remember destroy() method will behave like normal method
but not as life-cycle method.

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we get PrintWriter and ServletOutputStream both in a servlet?

633


What is the web server used for running the Servlets?

564


When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?

552


What are some advantages of storing session state in cookies?

581


How can a servlet be used to generate plain text instead of html?

528






Which protocol will be used by browser and servlet to communicate

559


How are filters?

555


Explain the steps involved in placing a servlet within a package?

551


What is the use of servlet context?

511


Which is the methods of generated servlet?

660


What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?

584


What is cookies in servlet with example?

501


What is servlet invoker?

581


What is dispatcher servlet?

535


What is servlet in tomcat?

537