Code example for AbstractAnnotationConfigDispatcherServletInitializer

Methods: onStartup

0
    @Override 
    public void onStartup( 
            ServletContext servletContext) throws ServletException { 
 
        /* Let super do its thing... */ 
        super.onStartup(servletContext); 
 
        /* Add the Spring Security filter. */ 
        servletContext.addFilter("springSecurityFilterChain", 
                new DelegatingFilterProxy()).addMappingForUrlPatterns(null, 
                false, "/*"); 
 
        // Add metrics servlet. 
        ServletRegistration.Dynamic metricsServlet = servletContext.addServlet( 
                "metrics", AdminServlet.class); 
        metricsServlet.addMapping("/metrics/*"); 
    } 
 
    @Override 
    public void contextInitialized(ServletContextEvent servletContextEvent) {