BAEL-89 - splitting controller and main application class

This commit is contained in:
slavisa-baeldung 2016-11-15 06:36:28 +01:00
parent a323947704
commit 3914a5d417
7 changed files with 43 additions and 30 deletions

View File

@ -5,4 +5,8 @@ spring.cloud.config.server.git.uri=file:///${user.home}/application-config
eureka.client.region = default
eureka.client.registryFetchIntervalSeconds = 5
eureka.client.serviceUrl.defaultZone=http://discUser:discPassword@localhost:8082/eureka/
eureka.client.serviceUrl.defaultZone=http://discUser:discPassword@localhost:8082/eureka/
security.user.name=configUser
security.user.password=configPassword
security.user.role=SYSTEM

View File

@ -1,8 +1,7 @@
package com.baeldung.spring.session.tomcatex;
package com.baeldung.spring.session.jettyex;
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
@ -11,14 +10,4 @@ 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 "";
}
}

View File

@ -1,4 +1,4 @@
package com.baeldung.spring.session.tomcatex;
package com.baeldung.spring.session.jettyex;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;

View File

@ -1,4 +1,4 @@
package com.baeldung.spring.session.tomcatex;
package com.baeldung.spring.session.jettyex;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -0,0 +1,12 @@
package com.baeldung.spring.session.jettyex;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
@RequestMapping
public String helloJetty() {
return "hello Jetty";
}
}

View File

@ -0,0 +1,23 @@
package com.baeldung.spring.session.tomcatex;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@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";
}
}

View File

@ -11,19 +11,4 @@ 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";
}
}