org.springframework.web.servlet.mvc.method.annotation

Interface ResponseBodyAdvice<T>

  • Type Parameters:
    T - the body type
    All Known Implementing Classes:
    AbstractMappingJacksonResponseBodyAdvice, JsonViewResponseBodyAdvice


    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 ExceptionHandlerExceptionResolver or more likely annotated with @ControllerAdvice in which case they will be auto-detected by both.

    Since:
    4.1
    Author:
    Rossen Stoyanchev