File tree Expand file tree Collapse file tree 2 files changed +1
-10
lines changed
spring-boot-samples/spring-boot-sample-tomcat/src/main Expand file tree Collapse file tree 2 files changed +1
-10
lines changed Original file line number Diff line number Diff line change 2020
2121import org .springframework .beans .factory .annotation .Autowired ;
2222import org .springframework .stereotype .Controller ;
23- import org .springframework .web .bind .annotation .ExceptionHandler ;
2423import org .springframework .web .bind .annotation .GetMapping ;
2524import org .springframework .web .bind .annotation .ResponseBody ;
26- import org .springframework .web .servlet .ModelAndView ;
2725
2826@ Controller
2927public class SampleController {
@@ -34,12 +32,7 @@ public class SampleController {
3432 @ GetMapping ("/" )
3533 @ ResponseBody
3634 public String helloWorld () {
37- throw new RuntimeException ("Fail" );
38- }
39-
40- @ ExceptionHandler (RuntimeException .class )
41- public ModelAndView handle (RuntimeException ex ) {
42- return null ;
35+ return this .helloWorldService .getHelloMessage ();
4336 }
4437
4538}
Original file line number Diff line number Diff line change 11server.compression.enabled: true
22server.compression.min-response-size: 1
33server.connection-timeout =5000
4-
5- spring.mvc.log-resolved-exception =true
You can’t perform that action at this time.
0 commit comments