what happen when i call the destroy() in init()method?
The destroy() method is usually called by the servlet container immediately before it takes a servlet out of service. It is typically used to clean-up any resource references, save temporary data and suchlike.
If the destroy() method is called from the init(ServletConfig) method, whatever statements are contained in the method will be executed and the method will return, it will not affect the lifecycle status of the servlet from the container's point of view.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.