I have one query regarding destroy() method. Suppose during init()...i intialized a factory of objects, or say a HashMap with some key-values. Now when server is shutdown, will those objects in HashMap be removed automatically or we have to make everything null in destroy..
Does this mean of release the resources or destroy() only used to release database/streams.
When you shut down the server, everyting in memory will be released. The destroy method is just a place for you to put code that you want executed when the servlet is taken out of service.