File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes calling destroy() in init() method in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

calling destroy() in init() method in servlet

priyanaka jaiswal
Ranch Hand

Joined: Jun 03, 2011
Posts: 79
Hi All,

Calling destroy() method inside init() will it destroy the servlet or init() method will continue it process?

Thanks in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

It will simply call the method. Why would you even wonder about doing something so nonsensical?

[Asking smart questions] [About Bear] [Books by Bear]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19856

That exact question is already in the Ranch's Servlets FAQ. Have a look there.
subject: calling destroy() in init() method in servlet
It's not a secret anymore!