接口 ResponseBodyAdvice<T>

类型参数:
T - the body type
所有已知实现类:
AbstractMappingJacksonResponseBodyAdvice, JsonViewResponseBodyAdvice, RequestResponseBodyAdviceChain

public interface ResponseBodyAdvice<T>
Allows customizing the response after the execution of an @ResponseBody or a ResponseEntity controller method but before the body is written with an HttpMessageConverter.

Implementations may be registered directly with RequestMappingHandlerAdapter and ExceptionHandlerExceptionHandler or more likely annotated with @ControllerAdvice in which case they will be auto-detected by both.

从以下版本开始:
4.0 2022/1/22 21:43
作者:
Rossen Stoyanchev, Harry Yang
  • 方法概要

    修饰符和类型
    方法
    说明
    beforeBodyWrite(Object body, cn.taketoday.core.MethodParameter returnType, MediaType contentType, HttpMessageConverter<?> converter, RequestContext context)
    Invoked after an HttpMessageConverter is selected and just before its write method is invoked.
    boolean
    supports(Object body, cn.taketoday.core.MethodParameter returnType, HttpMessageConverter<?> converter)
    Whether this component supports the given controller method return type and the selected HttpMessageConverter type.