Code example for AbstractAnnotationConfigDispatcherServletInitializer

0
 
/** 
 * Creates the api-dispatcher for the API servlet with the correct configuration classes. 
 * @author Moritz Schulze 
 */ 
public class ApiWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { 
 
    @Override 
    protected Class<?>[] getRootConfigClasses() { 
        return new Class<?>[] {}; 
    } 
 
    @Override 
    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}; 
    } 
 
    @Override 
Experience pair programming with AI  Get Codota for Java