diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/FrontendConfig.java b/spring-security-basic-auth/src/main/java/org/baeldung/spring/config/FrontendConfig.java similarity index 52% rename from spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/FrontendConfig.java rename to spring-security-basic-auth/src/main/java/org/baeldung/spring/config/FrontendConfig.java index ffcc855716..693b1006b5 100644 --- a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/FrontendConfig.java +++ b/spring-security-basic-auth/src/main/java/org/baeldung/spring/config/FrontendConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.web.config; +package org.baeldung.spring.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -13,27 +13,27 @@ import org.springframework.web.servlet.view.JstlView; @Configuration public class FrontendConfig extends WebMvcConfigurerAdapter { - public FrontendConfig() { - super(); - } + public FrontendConfig() { + super(); + } - // API + // API - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); + @Override + public void addViewControllers(final ViewControllerRegistry registry) { + super.addViewControllers(registry); - registry.addViewController("/homepage.html"); - } + registry.addViewController("/homepage.html"); + } - @Bean - public ViewResolver viewResolver() { - final InternalResourceViewResolver bean = new InternalResourceViewResolver(); + @Bean + public ViewResolver viewResolver() { + final InternalResourceViewResolver bean = new InternalResourceViewResolver(); - bean.setViewClass(JstlView.class); - bean.setPrefix("/WEB-INF/view/"); - bean.setSuffix(".jsp"); + bean.setViewClass(JstlView.class); + bean.setPrefix("/WEB-INF/view/"); + bean.setSuffix(".jsp"); - return bean; - } + return bean; + } } \ No newline at end of file diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/SecSecurityConfig.java b/spring-security-basic-auth/src/main/java/org/baeldung/spring/config/SecSecurityConfig.java similarity index 71% rename from spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/SecSecurityConfig.java rename to spring-security-basic-auth/src/main/java/org/baeldung/spring/config/SecSecurityConfig.java index 65a571c715..a8b4962672 100644 --- a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/SecSecurityConfig.java +++ b/spring-security-basic-auth/src/main/java/org/baeldung/spring/config/SecSecurityConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.web.config; +package org.baeldung.spring.config; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; @@ -7,8 +7,8 @@ import org.springframework.context.annotation.ImportResource; @ImportResource({ "classpath:webSecurityConfig.xml" }) public class SecSecurityConfig { - public SecSecurityConfig() { - super(); - } + public SecSecurityConfig() { + super(); + } } diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/WebConfig.java b/spring-security-basic-auth/src/main/java/org/baeldung/spring/config/WebConfig.java similarity index 77% rename from spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/WebConfig.java rename to spring-security-basic-auth/src/main/java/org/baeldung/spring/config/WebConfig.java index 9a79aa3b6b..c6d3aa896b 100644 --- a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/config/WebConfig.java +++ b/spring-security-basic-auth/src/main/java/org/baeldung/spring/config/WebConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.web.config; +package org.baeldung.spring.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -8,10 +8,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter @ComponentScan("org.baeldung.spring.web.controller") public class WebConfig extends WebMvcConfigurerAdapter { - public WebConfig() { - super(); - } + public WebConfig() { + super(); + } - // API + // API } \ No newline at end of file diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/controller/TestController.java b/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/controller/TestController.java deleted file mode 100644 index c7b04c14d2..0000000000 --- a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/controller/TestController.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.baeldung.spring.web.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class TestController { - - public TestController() { - super(); - } - - // API - - @RequestMapping("/permitAll") - @ResponseBody - public String permitAll() { - return "Permit All"; - } - - @RequestMapping("/securityNone") - @ResponseBody - public String securityNone() { - return "Security None"; - } - -} diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/controller/FooController.java b/spring-security-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java similarity index 90% rename from spring-security-basic-auth/src/main/java/org/baeldung/spring/web/controller/FooController.java rename to spring-security-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java index eb0575f279..a80ab832b3 100644 --- a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/controller/FooController.java +++ b/spring-security-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java @@ -1,8 +1,8 @@ -package org.baeldung.spring.web.controller; +package org.baeldung.web.controller; import javax.servlet.http.HttpServletResponse; -import org.baeldung.spring.web.Foo; +import org.baeldung.web.dto.Foo; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/web/controller/TestController.java b/spring-security-basic-auth/src/main/java/org/baeldung/web/controller/TestController.java new file mode 100644 index 0000000000..f68cfb2eb7 --- /dev/null +++ b/spring-security-basic-auth/src/main/java/org/baeldung/web/controller/TestController.java @@ -0,0 +1,28 @@ +package org.baeldung.web.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +public class TestController { + + public TestController() { + super(); + } + + // API + + @RequestMapping("/permitAll") + @ResponseBody + public String permitAll() { + return "Permit All"; + } + + @RequestMapping("/securityNone") + @ResponseBody + public String securityNone() { + return "Security None"; + } + +} diff --git a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/Foo.java b/spring-security-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java similarity index 78% rename from spring-security-basic-auth/src/main/java/org/baeldung/spring/web/Foo.java rename to spring-security-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java index a5e46bc8e5..352045989d 100644 --- a/spring-security-basic-auth/src/main/java/org/baeldung/spring/web/Foo.java +++ b/spring-security-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.web; +package org.baeldung.web.dto; import java.io.Serializable; diff --git a/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-rest/src/main/resources/webSecurityConfig.xml index d3f8f6cfaf..f53b15752c 100644 --- a/spring-security-rest/src/main/resources/webSecurityConfig.xml +++ b/spring-security-rest/src/main/resources/webSecurityConfig.xml @@ -21,7 +21,7 @@ - +