From 28c1bc99861813b9a8694c3921da3569734e45c5 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Tue, 19 Jun 2018 15:02:45 +0200 Subject: [PATCH] Fix DefaultErrorViewResolver after HttpStatus changes Since SPR-16898, `HttpStatus.toString()` has changed and we should instead rely on `HttpStatus.value()` to get the HTTP status number. --- .../web/servlet/error/DefaultErrorViewResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java index 829c13c637..c005f2e471 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/DefaultErrorViewResolver.java @@ -102,7 +102,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered { @Override public ModelAndView resolveErrorView(HttpServletRequest request, HttpStatus status, Map model) { - ModelAndView modelAndView = resolve(String.valueOf(status), model); + ModelAndView modelAndView = resolve(String.valueOf(status.value()), model); if (modelAndView == null && SERIES_VIEWS.containsKey(status.series())) { modelAndView = resolve(SERIES_VIEWS.get(status.series()), model); }