1 / 4
文档名称:

springmvc注解(SpringMVC注解).doc

格式:doc   大小:18KB   页数:4页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

springmvc注解(SpringMVC注解).doc

上传人:Seiryu 2021/12/18 文件大小:18 KB

下载得到文件列表

springmvc注解(SpringMVC注解).doc

文档介绍

文档介绍:spring mvc注解(Spring MVC注解)
spring mvc注解(Spring MVC注解)
***@Autowired
(not recommended, recommended to use ***@Resource)?
***@Autowired can annotate member variables, methods, and constructors to complete automatic assembly work.
The ***@Autowired's annotation positions are different, and they all automatically assemble this property when Spring initializes the bean.
To enable ***@Autowired to work, you also need to include the following Xml code in the configuration file?
<bean? Class= / >
""?
***@Autowired can annotate members, variables, methods, and constructors
***@Component
Is a generalization of the concept that only represents a component (Bean) that can be applied at any level.
***@Constroller
Usually at the control level, but the function is the same as ***@Component.
***@PostConstruct
Annotation methods are triggered when Boss Bean is created at the start of the Spring container
***@PreDestroy
The annotation method is triggered when the Spring container is destroyed and destroyed when Boss Bean is executed
***@Qualifier
The XX in ***@Qualifier ("XXX") is the name of Bean, so when ***@Autowired and ***@Qualifier are combined, the auto injection policy changes from byType to byName.
***@Qualifier's annotation objects are member variables, method entry, and constructor admission.
***@Repository
Why