spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

ErrorPageFilter

Open ahirsh opened this issue 11 years ago • 1 comments

Hi , i have a controller which produces JSON and XML. allthough i dont use HTML ErrorPageFilter is throwing messages to log because the response was commited . it happens in handleErrorStatus function when i throw exception from my controller. i ended up disabling the ErrorPageFilter with :

@Bean public FilterRegistrationBean filterRegistrationBean(ErrorPageFilter errorPageFilter) { FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(errorPageFilter); registrationBean.setEnabled(false); return registrationBean; } but i think spring boot should maybe detect that the response was not html and not use the filter at all .... thanks.

ahirsh avatar Apr 19 '15 13:04 ahirsh

Duplicates #2745

wilkinsona avatar Apr 19 '15 13:04 wilkinsona