Update StudentControllerConfig.java (#569)

Making formatting changes
This commit is contained in:
prashant1067 2016-08-02 11:51:30 +05:30 committed by Grzegorz Piwowarek
parent 797db0f8e9
commit 3a6206c666
1 changed files with 14 additions and 20 deletions

View File

@ -12,26 +12,20 @@ import org.springframework.web.servlet.DispatcherServlet;
public class StudentControllerConfig implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext sc) throws ServletException {
AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext();
root.register(WebConfig.class);
root.refresh();
root.setServletContext(sc);
// Manages the lifecycle of the root application context
sc.addListener(new ContextLoaderListener(root));
DispatcherServlet dv = new DispatcherServlet(new GenericWebApplicationContext());
DispatcherServlet dv =new DispatcherServlet(new GenericWebApplicationContext());
ServletRegistration.Dynamic appServlet = sc.addServlet("test-mvc",dv );
ServletRegistration.Dynamic appServlet = sc.addServlet("test-mvc", dv);
appServlet.setLoadOnStartup(1);
appServlet.addMapping("/test/*");
}
}
}