Merge pull request #11499 from kwoyke/JAVA-8664
JAVA-8664: Change ports numbers and cleanup the code
This commit is contained in:
commit
679df8513e
|
@ -1,22 +1,18 @@
|
|||
package com.baeldung.ctx1;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.baeldung.parent.IHomeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Controller
|
||||
@RestController
|
||||
public class Ctx1Controller {
|
||||
|
||||
@Autowired
|
||||
IHomeService homeService;
|
||||
private IHomeService homeService;
|
||||
|
||||
@GetMapping("/home")
|
||||
@ResponseBody
|
||||
public String greeting() {
|
||||
|
||||
return homeService.getGreeting();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package com.baeldung.ctx2;
|
||||
|
||||
import com.baeldung.parent.IHomeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baeldung.parent.IHomeService;
|
||||
|
||||
@RestController
|
||||
public class Ctx2Controller {
|
||||
|
||||
@Autowired
|
||||
IHomeService homeService;
|
||||
private IHomeService homeService;
|
||||
|
||||
@GetMapping(value = "/greeting", produces = "application/json")
|
||||
@GetMapping("/greeting")
|
||||
public String getGreeting() {
|
||||
return homeService.getGreeting();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
server.port=8081
|
||||
server.port=8074
|
||||
server.servlet.context-path=/ctx1
|
||||
#logging.level=debug
|
||||
spring.application.admin.enabled=false
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
server.port=8082
|
||||
server.port=8075
|
||||
server.servlet.context-path=/ctx2
|
||||
|
||||
spring.application.admin.enabled=false
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baeldung.parent.App;
|
|||
public class SpringContextTest {
|
||||
|
||||
@Test
|
||||
public final void testMain() throws Exception {
|
||||
public final void testMain() {
|
||||
App.main(new String[] {});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue