Code example for AbstractAnnotationConfigDispatcherServletInitializer

 * Creates the api-dispatcher for the API servlet with the correct configuration classes. 
 * @author Moritz Schulze 
public class ApiWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { 
    protected Class<?>[] getRootConfigClasses() { 
        return new Class<?>[] {}; 
    protected Class<?>[] getServletConfigClasses() { 
        //The global method security is only in the root context, to protect RequestMappings in custom controllers 
        //we load the the MethodSecurityConfiguration here, too. 
        return new Class<?>[] {ApiWebMvcConfiguration.class, MethodSecurityConfiguration.class, MailConfiguration.class, ScheduledJobsConfiguration.class};