Annotation Interface RestController
@Controller and @ResponseBody.
Types that carry this annotation are treated as controllers where
@RequestMapping methods assume
@ResponseBody semantics by default.
NOTE: @RestController 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.
- 从以下版本开始:
- 2018-11-17 21:26
- 作者:
- Rossen Stoyanchev, Sam Brannen, Harry Yang
-
可选元素概要
可选元素修饰符和类型可选元素说明booleanIs this bean a candidate for getting autowired into some other bean?The optional names of a method to call on the bean instance upon closing the application context, for example aclose()method on a JDBCDataSourceimplementation, or a HibernateSessionFactoryobject.String[]The optional name of a method to call on the bean instance during initialization.String[]The value may indicate a suggestion for a logical component name, to be turned into a Infra bean in case of an autodetected component.
-
元素详细资料
-
value
The value may indicate a suggestion for a logical component name, to be turned into a Infra bean in case of an autodetected component.- 返回:
- the suggested component name, if any (or empty String otherwise)
- 默认值:
- {}
-
initMethods
The optional name of a method to call on the bean instance during initialization. Not commonly used, given that the method may be called programmatically directly within the body of a Bean-annotated method.The default value is
"", indicating no init method to be called.- 另请参阅:
-
InitializingBeanConfigurableApplicationContext.refresh()
- 默认值:
- {}
-
destroyMethod
The optional names of a method to call on the bean instance upon closing the application context, for example aclose()method on a JDBCDataSourceimplementation, or a HibernateSessionFactoryobject. The method must have no arguments but may throw any exception.Note: Only invoked on beans whose lifecycle is under the full control of the factory, which is always the case for singletons but not guaranteed for any other scope.
- 另请参阅:
-
DisposableBeanConfigurableApplicationContext.close()
- 默认值:
- "(inferred)"
-
autowireCandidate
@AliasFor(annotation=cn.taketoday.stereotype.Component.class) boolean autowireCandidateIs this bean a candidate for getting autowired into some other bean?Default is
true; set this tofalsefor internal delegates that are not meant to get in the way of beans of the same type in other places.- 从以下版本开始:
- 4.0
- 默认值:
- true
-