2021年2月1日

Spring 中@Autowire 与@Resource的区别?

摘要: Spring 中@Autowire 与@Resource的区别? @Autowire默认按照类型装配, 默认情况下它要求依赖对象必须存在如果允许为null, 可以设置它required属性为false,如果我们想使用按照名称装配,可以结合@Qualifier注解一起使用; @Resource默认按照 阅读全文

posted @ 2021-02-01 19:15 liqiangbk 阅读(142) 评论(0) 推荐(0) 编辑

导航