From e68379871e02004c35ff242923889686c4892243 Mon Sep 17 00:00:00 2001 From: Eugen Date: Mon, 3 Jun 2013 18:46:10 +0300 Subject: [PATCH] injection work --- spring-security-rest-full/.springBeans | 2 +- .../web/controller/FooController.java | 3 ++ .../web/controller/TestController.java | 28 ------------------- .../web/{controller => util}/LinkUtil.java | 2 +- .../{controller => util}/ResourceCreated.java | 2 +- ...esourceCreatedDiscoverabilityListener.java | 2 +- .../SingleResourceRetrieved.java | 2 +- ...ourceRetrievedDiscoverabilityListener.java | 2 +- .../{mvc-servlet.xml => api-servlet.xml} | 0 .../src/main/webapp/WEB-INF/web.xml | 4 +-- 10 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 spring-security-rest-full/src/main/java/org/baeldung/web/controller/TestController.java rename spring-security-rest-full/src/main/java/org/baeldung/web/{controller => util}/LinkUtil.java (95%) rename spring-security-rest-full/src/main/java/org/baeldung/web/{controller => util}/ResourceCreated.java (95%) rename spring-security-rest-full/src/main/java/org/baeldung/web/{controller => util}/ResourceCreatedDiscoverabilityListener.java (97%) rename spring-security-rest-full/src/main/java/org/baeldung/web/{controller => util}/SingleResourceRetrieved.java (94%) rename spring-security-rest-full/src/main/java/org/baeldung/web/{controller => util}/SingleResourceRetrievedDiscoverabilityListener.java (97%) rename spring-security-rest-full/src/main/webapp/WEB-INF/{mvc-servlet.xml => api-servlet.xml} (100%) diff --git a/spring-security-rest-full/.springBeans b/spring-security-rest-full/.springBeans index 7623a7e888..d11fb034bd 100644 --- a/spring-security-rest-full/.springBeans +++ b/spring-security-rest-full/.springBeans @@ -7,7 +7,7 @@ - src/main/webapp/WEB-INF/mvc-servlet.xml + src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-rest-full/src/main/java/org/baeldung/web/controller/FooController.java index cf4b976b90..7452cc7c24 100644 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/FooController.java +++ b/spring-security-rest-full/src/main/java/org/baeldung/web/controller/FooController.java @@ -7,6 +7,9 @@ import javax.servlet.http.HttpServletResponse; import org.baeldung.persistence.model.Foo; import org.baeldung.persistence.service.impl.FooService; +import org.baeldung.web.util.LinkUtil; +import org.baeldung.web.util.ResourceCreated; +import org.baeldung.web.util.SingleResourceRetrieved; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpStatus; diff --git a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/TestController.java b/spring-security-rest-full/src/main/java/org/baeldung/web/controller/TestController.java deleted file mode 100644 index f68cfb2eb7..0000000000 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/TestController.java +++ /dev/null @@ -1,28 +0,0 @@ -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-rest-full/src/main/java/org/baeldung/web/controller/LinkUtil.java b/spring-security-rest-full/src/main/java/org/baeldung/web/util/LinkUtil.java similarity index 95% rename from spring-security-rest-full/src/main/java/org/baeldung/web/controller/LinkUtil.java rename to spring-security-rest-full/src/main/java/org/baeldung/web/util/LinkUtil.java index a41ebb5a5c..9e8979e4bd 100644 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/LinkUtil.java +++ b/spring-security-rest-full/src/main/java/org/baeldung/web/util/LinkUtil.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package org.baeldung.web.util; import javax.servlet.http.HttpServletResponse; diff --git a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/ResourceCreated.java b/spring-security-rest-full/src/main/java/org/baeldung/web/util/ResourceCreated.java similarity index 95% rename from spring-security-rest-full/src/main/java/org/baeldung/web/controller/ResourceCreated.java rename to spring-security-rest-full/src/main/java/org/baeldung/web/util/ResourceCreated.java index a677888101..c471cc0818 100644 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/ResourceCreated.java +++ b/spring-security-rest-full/src/main/java/org/baeldung/web/util/ResourceCreated.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package org.baeldung.web.util; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/ResourceCreatedDiscoverabilityListener.java b/spring-security-rest-full/src/main/java/org/baeldung/web/util/ResourceCreatedDiscoverabilityListener.java similarity index 97% rename from spring-security-rest-full/src/main/java/org/baeldung/web/controller/ResourceCreatedDiscoverabilityListener.java rename to spring-security-rest-full/src/main/java/org/baeldung/web/util/ResourceCreatedDiscoverabilityListener.java index 8d19ef82fc..fbfd2fd085 100644 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/ResourceCreatedDiscoverabilityListener.java +++ b/spring-security-rest-full/src/main/java/org/baeldung/web/util/ResourceCreatedDiscoverabilityListener.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package org.baeldung.web.util; import java.net.URI; diff --git a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/SingleResourceRetrieved.java b/spring-security-rest-full/src/main/java/org/baeldung/web/util/SingleResourceRetrieved.java similarity index 94% rename from spring-security-rest-full/src/main/java/org/baeldung/web/controller/SingleResourceRetrieved.java rename to spring-security-rest-full/src/main/java/org/baeldung/web/util/SingleResourceRetrieved.java index 3de7918105..143a73da65 100644 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/SingleResourceRetrieved.java +++ b/spring-security-rest-full/src/main/java/org/baeldung/web/util/SingleResourceRetrieved.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package org.baeldung.web.util; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/SingleResourceRetrievedDiscoverabilityListener.java b/spring-security-rest-full/src/main/java/org/baeldung/web/util/SingleResourceRetrievedDiscoverabilityListener.java similarity index 97% rename from spring-security-rest-full/src/main/java/org/baeldung/web/controller/SingleResourceRetrievedDiscoverabilityListener.java rename to spring-security-rest-full/src/main/java/org/baeldung/web/util/SingleResourceRetrievedDiscoverabilityListener.java index 45cd7c4d13..61fb601ac9 100644 --- a/spring-security-rest-full/src/main/java/org/baeldung/web/controller/SingleResourceRetrievedDiscoverabilityListener.java +++ b/spring-security-rest-full/src/main/java/org/baeldung/web/util/SingleResourceRetrievedDiscoverabilityListener.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package org.baeldung.web.util; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/spring-security-rest-full/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-rest-full/src/main/webapp/WEB-INF/api-servlet.xml similarity index 100% rename from spring-security-rest-full/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-rest-full/src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-security-rest-full/src/main/webapp/WEB-INF/web.xml b/spring-security-rest-full/src/main/webapp/WEB-INF/web.xml index b02f62911e..d88703596f 100644 --- a/spring-security-rest-full/src/main/webapp/WEB-INF/web.xml +++ b/spring-security-rest-full/src/main/webapp/WEB-INF/web.xml @@ -26,12 +26,12 @@ - mvc + api org.springframework.web.servlet.DispatcherServlet 1 - mvc + api /