title: Spring bean's DESTROY-METHOD attribute and web-application "prototype"d bean
body: <p>Can get work the attribute "destroy-method".</p>
  
  <p>First, even if I type non-existing method name into "destroy-method" attribute, </p>
  
  <p>Spring initialization completes fine (already strange!).</p>
  
  <p>Next, when a bean has a "prototype" scope, then I suppose it must be destroyed before the application</p>
  
  <p>is closed. That not happens, it is simply never called in my case.</p>
  
  <p>Though, after extracting this bean I can call this method explicitly and it does its job.</p>
  
  <p>Could you explain why this method is never called in my Spring 2.5 case?</p>
  
  <p>p.s. The method exists, it is public and has no arguments.</p>
  
  <p>It seems to be a more difficult task then I thought.</p>
  
  <p>The problem is that this destroy method is called whenever the context is closed, and
  this is a rare case.</p>
  
  <p>My question is this:</p>
  
  <p><b></p>
  
  <p>I have a web app. I have a "prototype"-scoped bean.</p>
  
  <p>What I need is when the current session is closed, this destroy method was automatically called by Spring.</p>
  
  <p>I can do it by hand, but is there any solution how to make Spring do this job? It destroys the bean after the session is destroyed, it might be possible for Spring to call a method on that bean before destroying it?
  </b></p>
  
  <p>p.s. Spring does not manage the lifecycle of prototype beans, so Spring does not destroy them :)</p>