diff --git a/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/web/SampleController.java b/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/web/SampleController.java index 1098b60acf..d608fff1b8 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/web/SampleController.java +++ b/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/web/SampleController.java @@ -20,10 +20,8 @@ import sample.tomcat.service.HelloWorldService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; @Controller public class SampleController { @@ -34,12 +32,7 @@ public class SampleController { @GetMapping("/") @ResponseBody public String helloWorld() { - throw new RuntimeException("Fail"); - } - - @ExceptionHandler(RuntimeException.class) - public ModelAndView handle(RuntimeException ex) { - return null; + return this.helloWorldService.getHelloMessage(); } } diff --git a/spring-boot-samples/spring-boot-sample-tomcat/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-tomcat/src/main/resources/application.properties index 3455c57ddf..4c0dadec6d 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat/src/main/resources/application.properties +++ b/spring-boot-samples/spring-boot-sample-tomcat/src/main/resources/application.properties @@ -1,5 +1,3 @@ server.compression.enabled: true server.compression.min-response-size: 1 server.connection-timeout=5000 - -spring.mvc.log-resolved-exception=true