这篇文章讲的很好。
http://howtodoinjava.com/spring/spring-core/spring-beans-autowiring-concepts/
spring的自动注入实现了bean之间的DI,分为五种:
- 默认为no
- byName
- byType
- byConstructor
- autodetect 首先按4 没有再按3
这篇文章讲的很好。
http://howtodoinjava.com/spring/spring-core/spring-beans-autowiring-concepts/
spring的自动注入实现了bean之间的DI,分为五种: