@ResponseBody
or a ResponseEntity controller method but before the body is written
with an HttpMessageConverter.
Implementations may be registered directly with
RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
or more likely annotated with @ControllerAdvice in which case they
will be auto-detected by both.
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: the body that was passed in or a modified (possibly new) instancethe body to be written body, MethodParameter the return type of the controller method returnType, MediaType the content type selected through content negotiation selectedContentType, Class<? extends HttpMessageConverter<?>> the converter type selected to write to the response selectedConverterType, ServerHttpRequest the current request request, ServerHttpResponse the current response response)Invoked after an |
| public boolean | supports(MethodParameter
the return type returnType, Class<? extends HttpMessageConverter<?>> the selected converter type converterType)Whether this component supports the given controller method return type
and the selected |
| beforeBodyWrite | back to summary |
|---|---|
| public T beforeBodyWrite(T body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) Invoked after an
| |
| supports | back to summary |
|---|---|
| public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) Whether this component supports the given controller method return type
and the selected
| |