Fix formatting in StudentControllerConfig

This commit is contained in:
Grzegorz Piwowarek 2016-08-02 08:42:44 +02:00
parent c3766c0138
commit d13794a0c1

View File

@ -1,15 +1,15 @@
package org.baeldung.controller.config;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.context.support.GenericWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
public class StudentControllerConfig implements WebApplicationInitializer {
@ -21,17 +21,13 @@ public class StudentControllerConfig implements WebApplicationInitializer {
root.refresh();
root.setServletContext(sc);
// Manages the lifecycle of the root application context
sc.addListener(new ContextLoaderListener(root));
DispatcherServlet dv = new DispatcherServlet(new GenericWebApplicationContext());
ServletRegistration.Dynamic appServlet = sc.addServlet("test-mvc", dv);
appServlet.setLoadOnStartup(1);
appServlet.addMapping("/test/*");
}
}