title: Register shutDownHook in web application
body: <p>How we can registerShutdown hook in web application?</p>
  
  <p>Is there any whays to register it in web.xml or in applicationContext.xml?</p>
  
  <p>I know that if we are using application with main class it's simple.</p>
  
  <pre><code>ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContext.xml");
      context.registerShutdownHook();
  </code></pre>
  
  <p>But what about web application? As it uses ContextListener</p>