spring-framework / org.springframework.web.bind.annotation / RestControllerAdvice / <init>

<init>

RestControllerAdvice(vararg value: String, basePackages: Array<String>, basePackageClasses: Array<KClass<*>>, assignableTypes: Array<KClass<*>>, annotations: Array<KClass<out Annotation>>)

A convenience annotation that is itself annotated with ControllerAdvice and ResponseBody.

Types that carry this annotation are treated as controller advice where ExceptionHandler methods assume ResponseBody semantics by default.

NOTE: @RestControllerAdvice is processed if an appropriate HandlerMapping-HandlerAdapter pair is configured such as the RequestMappingHandlerMapping-RequestMappingHandlerAdapter pair which are the default in the MVC Java config and the MVC namespace.

Author
Rossen Stoyanchev

Since
4.3