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

Answer Posted / tanuj

yes,

but genricServlet init() method initialization is different
from overriding it by you (we should not orride it).

destroy() method is used for closing many connections as
itit() method is used for starting some database and other
things.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is a constructor needed in a servlet even if we use the init method?

602


Difference between httpservlet and generic servlets?

602


Explain servlet.

565


What do you mean by chaining in servlet?

566


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

563






What is cookies in servlet with example?

516


What are the types of servlet?

662


Define the lifecycle for executing a jsp page.

589


What is servlet in tomcat?

557


What exactly is a servlet?

537


What is lazy loading and what is Generic Servlet Class?

604


What is servlet configuration?

522


Which method is called when reference variable is passed in system.net?

1827


What are the uses of servlets?

616


Why is servlet used?

676