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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / suresh

when the sevlet is load the class files,in this time to call
init() method is called

destroy method used to the servlet remove from the memory

Is This Answer Correct ?    6 Yes 3 No

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

Answer / arulmani

init()method will be called by the webcontainer with the
servlet object by passig the ServletConfig object,when the
servlet object will be created.

destroy()method will be called by the webcontainer when
servlet object will be destroyed

Is This Answer Correct ?    1 Yes 0 No

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

Answer / giridhar gangapatnam

I think it is not possible to call init() method from
destroy() method of servlet.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / jimmi prajapti

Yes We can Call init() method from destroy() of Servlet

Is This Answer Correct ?    5 Yes 7 No

Post New Answer

More Servlets Interview Questions

How can a servlet refresh automatically if some new data has entered the database?

3 Answers   Citi Bank, CitiGroup, IBM, Satyam,


What is HTTP Tunneling?

1 Answers   Wipro,


What are the types of an http request?

0 Answers  


Servlet Chaining? How do you do the Filtering in Servlets?

6 Answers   HCL,


What are different Authentication options available in Servlets.

0 Answers  






Why are servlets used?

0 Answers  


when the webcontainer creates ServeletConfig,ServletContext objects? befoure creating the Servlet object or not?

4 Answers   TCS,


What do you mean by filter in servlet?

0 Answers  


What is filter? Can filter be used as request or response?

1 Answers  


i need connection pooling code.....from harpreet.your@gmail.com

1 Answers   IBM,


describe all about advanced java with presentation

4 Answers   Sun Microsystems,


What is done after deploying a war file and before client gives a request

2 Answers   Bosch,


Categories