title: How to get DispatcherServeletInitializer functionality in Spring Boot
body: <p>We are looking to migrate our project to Spring Boot. However it is unclear how to replicate the   functionality of <code>AbstractAnnotationConfigDispatcherServletInitializer</code> in Spring Boot?</p>
  
  <pre><code>public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer
  {
  @Override
  protected Class&lt;?&gt;[] getRootConfigClasses()
  {
      return new Class&lt;?&gt;[]{AppConfig.class};
  }
  
  @Override
  protected Class&lt;?&gt;[] getServletConfigClasses()
  {
      return new Class&lt;?&gt;[]{WebappConfig.class};
  }
  @Override
  protected void customizeRegistration(ServletRegistration.Dynamic registration) {
      registration.setAsyncSupported(true);
  }
  
  @Override
  protected String[] getServletMappings()
  {
      return new String[]{"/"};
  }
  
  @Override
  protected Filter[] getServletFilters()
  {
      DelegatingFilterProxy shiroFilter = new DelegatingFilterProxy("shiroFilter");
      shiroFilter.setTargetFilterLifecycle(true);
  
      CompositeFilter compositeFilter = new CompositeFilter();
      compositeFilter.setFilters(ImmutableList.of(new CorsFilter(),shiroFilter));
  
      return new Filter[]{compositeFilter};
  }
  </code></pre>
  
  <p>}</p>