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

When should you prefer to use doget() over dopost()?

0 Answers  


What is ServletContext() and what is its use?

9 Answers   Prime Technology, TCS,


Define the life cycle of a servlets.

0 Answers  


what are binding listners?

1 Answers  


What is difference between Forward() and sendRedirect() methode?

14 Answers   Polaris,


What is URL Encoding?

0 Answers  


Why servlet is used as controller ? Not JSP? I want complete explation?

0 Answers   Tech Mahindra,


Explain the war file?

0 Answers  


What is the role of the webserver?

4 Answers  


How to upload a file to the server using servlet?

0 Answers  


List out the difference between ServletConfig and ServletContext?

0 Answers  


What are the different mode that servlets can be used?

0 Answers  


Categories