From 58e704a0b873a965d7c9062e6b37a9c8f4265b5b Mon Sep 17 00:00:00 2001 From: tschiman Date: Sat, 12 Nov 2016 09:30:44 -0700 Subject: [PATCH] BAEL-89 Spring session breaking out the controller and changing the formatting to be in line with the baeldung standard. --- .../session/tomcatex/JettyWebApplication.java | 13 ---------- .../session/tomcatex/TestController.java | 15 +++++++++++ .../session/tomcatex/TestController.java | 26 +++++++++++++++++++ .../tomcatex/TomcatWebApplication.java | 18 ------------- 4 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java create mode 100644 spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java diff --git a/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/JettyWebApplication.java b/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/JettyWebApplication.java index 7bbc776eaa..947abc2dff 100644 --- a/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/JettyWebApplication.java +++ b/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/JettyWebApplication.java @@ -2,23 +2,10 @@ package com.baeldung.spring.session.tomcatex; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; @SpringBootApplication -@RestController public class JettyWebApplication { public static void main(String[] args) { SpringApplication.run(JettyWebApplication.class, args); } - - @RequestMapping - public String helloJetty() { - return "hello Jetty"; - } - - @RequestMapping("/test") - public String lksjdf() { - return ""; - } } diff --git a/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java b/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java new file mode 100644 index 0000000000..6350a68041 --- /dev/null +++ b/spring-session/jetty-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java @@ -0,0 +1,15 @@ +package com.baeldung.spring.session.tomcatex; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by tschi on 11/12/2016. + */ +@RestController +public class TestController { + @RequestMapping + public String helloJetty() { + return "hello Jetty"; + } +} diff --git a/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java b/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java new file mode 100644 index 0000000000..c84204c6ee --- /dev/null +++ b/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TestController.java @@ -0,0 +1,26 @@ +package com.baeldung.spring.session.tomcatex; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by tschi on 11/12/2016. + */ +@RestController +public class TestController { + + @RequestMapping + public String helloDefault() { + return "hello default"; + } + + @RequestMapping("/tomcat") + public String helloTomcat() { + return "hello tomcat"; + } + + @RequestMapping("/tomcat/admin") + public String helloTomcatAdmin() { + return "hello tomcat admin"; + } +} diff --git a/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TomcatWebApplication.java b/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TomcatWebApplication.java index 58c6b807ec..fb4e059dd1 100644 --- a/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TomcatWebApplication.java +++ b/spring-session/tomcat-session-demo/src/main/java/com/baeldung/spring/session/tomcatex/TomcatWebApplication.java @@ -2,28 +2,10 @@ package com.baeldung.spring.session.tomcatex; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; @SpringBootApplication -@RestController public class TomcatWebApplication { public static void main(String[] args) { SpringApplication.run(TomcatWebApplication.class, args); } - - @RequestMapping - public String helloDefault() { - return "hello default"; - } - - @RequestMapping("/tomcat") - public String helloTomcat() { - return "hello tomcat"; - } - - @RequestMapping("/tomcat/admin") - public String helloTomcatAdmin() { - return "hello tomcat admin"; - } }