parent
4175061434
commit
be115a073c
@ -13,7 +13,7 @@ public class MyCustomErrorController implements ErrorController {
|
|||||||
|
|
||||||
@GetMapping(value = PATH)
|
@GetMapping(value = PATH)
|
||||||
public String error() {
|
public String error() {
|
||||||
return "Error heaven";
|
return "Error haven";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,9 +14,9 @@ public class ErrorController {
|
|||||||
return "Error Code: 400 occured.";
|
return "Error Code: 400 occured.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/errorHeaven")
|
@GetMapping("/errorHaven")
|
||||||
String errorHeaven() {
|
String errorHeaven() {
|
||||||
return "You have reached the heaven of errors!!!";
|
return "You have reached the haven of errors!!!";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class MyServletContainerCustomizationBean implements WebServerFactoryCust
|
|||||||
container.setContextPath("/springbootapp");
|
container.setContextPath("/springbootapp");
|
||||||
|
|
||||||
container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400"));
|
container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400"));
|
||||||
container.addErrorPages(new ErrorPage("/errorHeaven"));
|
container.addErrorPages(new ErrorPage("/errorHaven"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user