can i call destroy() method in init() method of servlet
Answer Posted / sunil jaiswal
Yes, we can call destroy method from init method without any worry. Destroy method will be called up as calling any other method. Request shall still be process afterwards through service method(doGet, doPost etc). Because calling destroy method doesnt mean the killing the servlet instance. Calling the init, service and destroy method is in the specification of servlet lifecycle. So we can not alter those specification through outside. Once the servlet container thinks the servlet is of no use at some time(at the server shutdown) the container surely will be calling up the destroy method prior to destroy the servlet instance.
Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
Can a jsp be called using a servlet?
Can we override servlet service method?
What is servlet looping or chaining?
What do you mean by session tracking and also explain its techniques?
Explain how to improve Servlet Performance?
What do you mean by filter in servlet?
How forward () method is different from send redirect () method?
How can the referrer and the target urls be used in servlet?
What are the life cycle methods of the servlet?
explain the advantages of servlet life cycle?
What are the servlet events?
List the Different types of servlet?
What is a server side include (ssi)
What is servlet mapping?
What are the uses of servlet and what is servlet chaining?