Annotation Type RestController
@Target(TYPE) @Retention(RUNTIME) @Documented @Controller @ResponseBody public @interface RestController
A convenience annotation that is itself annotated with@Controllerand@ResponseBody.Types that carry this annotation are treated as controllers where
@RequestMappingmethods assume@ResponseBodysemantics by default.NOTE:
@RestControlleris processed if an appropriateHandlerMapping-HandlerAdapterpair is configured such as theRequestMappingHandlerMapping-RequestMappingHandlerAdapterpair which are the default in the MVC Java config and the MVC namespace.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Sam Brannen
Element Detail
value
@AliasFor(annotation=Controller.class) String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.- Returns:
- the suggested component name, if any (or empty String otherwise)
- Since:
- 4.0.1
- Default:
- ""