You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change introduces a new ResponseBodyInterceptor interface that can
be used to modify the response after @responsebody or ResponseEntity
methods but before the body is actually written to the response with the
selected HttpMessageConverter.
The RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
each have a property to configure such interceptors. In addition both
RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
detect if any @ControllerAdvice bean implements ResponseBodyInterceptor
and use it accordingly.
Issue: SPR-10859
Copy file name to clipboardExpand all lines: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,16 +55,24 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
Copy file name to clipboardExpand all lines: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java
+48-23Lines changed: 48 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,9 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce
Copy file name to clipboardExpand all lines: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessor.java
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -57,12 +57,16 @@ public HttpEntityMethodProcessor(List<HttpMessageConverter<?>> messageConverters
Copy file name to clipboardExpand all lines: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java
+60-35Lines changed: 60 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -132,8 +132,11 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
Copy file name to clipboardExpand all lines: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -69,10 +69,15 @@ public RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> messageC
0 commit comments