Spring framework basics for java learning

Spring framework basics for java learning

0x00 Preface

Continue the previous article and continue to update the spring framework content.

0x01 bean auto load

Annotation auto loading

Beans can be automatically assembled in the spring framework. We just need to add autowire to the bean tag. Autowire properties:

no :缺省情况下,自动配置是通过“ref”属性手动设定
   	
byName:根据属性名称自动装配。如果一个bean的名称和其他bean属性的名称是一样的,将会自装配它。
   	
byType:按数据类型自动装配。如果一个bean的数据类型是用其它bean属性的数据类型,兼容并自动装配它。
   	
constructor:在构造函数参数的byType方式。
   	
autodetect:如果找到默认的构造函数,使用"自动装配用构造"否则,使用“按类型自动装配


@H_502_15@
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>