title: How to register ServletContextListener in spring boot
body: <p>Hello I'm trying to rewrite my old code to use Spring Boot. 
  I have one listener <code>public class ExecutorListener implements ServletContextListener</code>.</p>
  
  <p>How can I register this listener for Spring Boot? 
  I've tried:</p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan
  public class Application extends SpringBootServletInitializer {
  
      @Override
      public void onStartup(ServletContext servletContext) throws ServletException {
          super.onStartup(servletContext);
          servletContext.addListener(new ExecutorListener());
      }
  
  }
  </code></pre>
  
  <p>But the <code>contextInitialized</code> method is not called.</p>