From d13794a0c1e3a5727b095f1347541bda63ce960d Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Tue, 2 Aug 2016 08:42:44 +0200 Subject: [PATCH] Fix formatting in StudentControllerConfig --- .../config/StudentControllerConfig.java | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/spring-all/src/main/java/org/baeldung/controller/config/StudentControllerConfig.java b/spring-all/src/main/java/org/baeldung/controller/config/StudentControllerConfig.java index 2ae28b6b4a..746f084fd5 100644 --- a/spring-all/src/main/java/org/baeldung/controller/config/StudentControllerConfig.java +++ b/spring-all/src/main/java/org/baeldung/controller/config/StudentControllerConfig.java @@ -1,37 +1,33 @@ 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 { - @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()); - - ServletRegistration.Dynamic appServlet = sc.addServlet("test-mvc",dv ); - appServlet.setLoadOnStartup(1); - appServlet.addMapping("/test/*"); - } + @Override + public void onStartup(ServletContext sc) throws ServletException { + AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext(); + root.register(WebConfig.class); - } + root.refresh(); + root.setServletContext(sc); + + 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/*"); + } +}