When destroy method get call, will it call for each user please give the ans in detail?

Questions by sachinTest

Showing Answers 1 - 8 of 8 Answers

sunil

  • Aug 10th, 2006
 

Diffrance between Service() method and doget() method,,

if Request will come then Servlet Container take  the request and call to  by default service( )method  if there doget() or dopost() method available,,

In any situtaion service method call and if there any other method then implicit service() method call to doget() or dopost,, this is the perfect flow of the request.

  Was this answer useful?  Yes

Jyotsna

  • Aug 10th, 2006
 

Nope, the destroy method is called only for that user who is calling it, all the other users are still in existence working with the servlet instance.

  Was this answer useful?  Yes

veerendra Jote

  • Aug 16th, 2006
 

No, you Dont call destory() method, the web-container calls the destroy() method, only when, it sees that the container is shutting down OR when it finds that the servlet was modified after it was loaded into memory (if reloadable parameter is true). Before destory() method of that servlet is called, all the pending requests are normally completed, except when the container shutdown occurs.

purandhar

  • Aug 17th, 2006
 

the destoy method is called when container want to descrease the pool size and it will not called for every user it is container managed method.

Manish

  • Oct 3rd, 2006
 

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.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions