spring三种注入方式
构造器注入
@Autowired
public AService(BService bService) {
this.bService = bService;
}
set注入 (重点)
AService aService;
@Autowired
public void setaService(AService aService) {
this.aService = aService;
}
属性注入
@Autowired
AService aService;