title: Interceptor destroy method
body: <p>I have created a <code>Authentication Interceptor</code> in struts2.<br/>
  I have to check that when does the interceptor method get called.<br/>
  so i have printed method names on console.
  
  <p><strong>Here is my code</strong> </p>
  
  <pre><code>public class AuthenticationInterceptor implements Interceptor {
  
  @Override
  public void destroy() {
      System.out.println("AuthenticationInterceptor destroy");
  
  }
  
  @Override
  public void init() {
       System.out.println("AuthenticationInterceptor init");
  
  }
  
  @Override
  public String intercept(ActionInvocation actionInvocation) throws Exception    {
      System.out.println("AuthenticationInterceptor intercept");
      return actionInvocation.invoke();
     }
  } 
  </code></pre>
  
  <p><strong>Here is my package in struts.xml.</strong></p>
  
  <pre><code>&lt;package name="portfolioSecure" namespace="/secure" extends="portfolio"&gt;
  &lt;interceptors&gt;
  &lt;interceptor name="authenticationInterceptor" class="ask.portfolio.utility.AuthenticationInterceptor"&gt;&lt;/interceptor&gt;
  &lt;interceptor-stack name="secureStack"&gt;
  &lt;interceptor-ref name="authenticationInterceptor"&gt;&lt;/interceptor-ref&gt;
  &lt;interceptor-ref name="defaultStack"&gt;&lt;/interceptor-ref&gt;
  
  &lt;/interceptor-stack&gt;
  &lt;/interceptors&gt;
  &lt;default-interceptor-ref name="secureStack"&gt;&lt;/default-interceptor-ref&gt;
      &lt;action name="login" class="ask.portfolio.actions.Login"&gt;
          &lt;result name="success"&gt;/loginSuccess.jsp&lt;/result&gt;
          &lt;result name="error"&gt;/welcome.jsp&lt;/result&gt;
      &lt;/action&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p>when my application starts <strong>AuthenticationInterceptor init</strong> get printed on console<br/>
  and similarly <strong>AuthenticationInterceptor intercept</strong> also prints.But <strong>AuthenticationInterceptor destroy</strong> does not get printed even if i stop server
  i want to know when <strong>interceptors destroy method</strong> is called and what is postprocessing in interceptor is it related with destroy method().</p>