• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

destroy method

 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Instead of destroy being called by the container, can we explicity call the destroy method IN the service method.
tia
MB
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, strictly, it's just a method like any other, so yes, you can.
However, the container will call destroy when the servlet or JSP is unloaded, whether you have called it already or not, so you have to be careful that you make it safe to call twice if you plan to call it yourself.
What worries me though, is why you think it might be useful. Can you explain a little more what you want to do this for? It may be that we can suggest a better alternative.
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Actually I was thrown upon this question & was wondering what could be done. What I thought was that the destroy method would be over-ridden.
AW...thnx
MB
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic