Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what happens if i call destroy() method in init() or service() method ?

 
Praveen Vallabhaneni
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happens if i call destroy() method in init() or service() method ?
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its still java irrepective of whether it's a Servlet/EJB/Jsp. So the destroy() method gets called.

ram.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The javadocs make it clear that this method is called by the servlet container, not ever by servlet code. So I'd say that what happens in that case is up to the container, and definitely undefined.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The destroy method is a placeholder for your code.
The container will call it when the servlet's taken out of service.
Whatever you put in there will be executed.

If you call it yourself, the same thing will happen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!