Browse Source

Merge branch '1.5.x'

pull/7916/merge
Andy Wilkinson 9 years ago
parent
commit
3570b06ebf
  1. 2
      spring-boot/src/main/java/org/springframework/boot/web/support/ErrorPageFilter.java
  2. 6
      spring-boot/src/test/java/org/springframework/boot/web/support/ErrorPageFilterTests.java

2
spring-boot/src/main/java/org/springframework/boot/web/support/ErrorPageFilter.java

@ -177,7 +177,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry { @@ -177,7 +177,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry {
}
setErrorAttributes(request, 500, ex.getMessage());
request.setAttribute(ERROR_EXCEPTION, ex);
request.setAttribute(ERROR_EXCEPTION_TYPE, ex.getClass().getName());
request.setAttribute(ERROR_EXCEPTION_TYPE, ex.getClass());
response.reset();
response.sendError(500, ex.getMessage());
request.getRequestDispatcher(path).forward(request, response);

6
spring-boot/src/test/java/org/springframework/boot/web/support/ErrorPageFilterTests.java

@ -262,7 +262,7 @@ public class ErrorPageFilterTests { @@ -262,7 +262,7 @@ public class ErrorPageFilterTests {
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE))
.isEqualTo("BAD");
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE))
.isEqualTo(RuntimeException.class.getName());
.isEqualTo(RuntimeException.class);
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI))
.isEqualTo("/test/path");
assertThat(this.response.isCommitted()).isTrue();
@ -319,7 +319,7 @@ public class ErrorPageFilterTests { @@ -319,7 +319,7 @@ public class ErrorPageFilterTests {
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE))
.isEqualTo("BAD");
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE))
.isEqualTo(IllegalStateException.class.getName());
.isEqualTo(IllegalStateException.class);
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI))
.isEqualTo("/test/path");
assertThat(this.response.isCommitted()).isTrue();
@ -493,7 +493,7 @@ public class ErrorPageFilterTests { @@ -493,7 +493,7 @@ public class ErrorPageFilterTests {
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE))
.isEqualTo("BAD");
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE))
.isEqualTo(RuntimeException.class.getName());
.isEqualTo(RuntimeException.class);
assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI))
.isEqualTo("/test/path");
assertThat(this.response.isCommitted()).isTrue();

Loading…
Cancel
Save