I have written a servlet code and tried to call the servlet's destroy method. Now I can able to call the destroy method. What happens after i call that method ?.. weather it will remove the servlet ?.. if not what it will do ?..
Looks like it does nothing. It's there for you to override and put your cleanup code in.
Quote from the Servlet Specs SRV.22.214.171.124
destroy() public void destroy() Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. This method is only called once all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls this method, it will not call the service method again on this servlet. This method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the servlet's current state in memory.