SpringBoot 相关事项

1. @Autowired和@Resource的区别

  A. @Autowired属于Spring的注解,按byType自动注入bean,而@Resource属于J2EE的注解,按byName自动注入bean,都可以写在字段或setter方法上;

  B. @Autowired想指定名字,则借助@Qualifier("name")注解

https://blog.csdn.net/weixin_40423597/article/details/80643990

https://blog.csdn.net/qq_36089832/article/details/93222134

https://blog.csdn.net/yeshu2780/article/details/105295952

猜你喜欢

转载自www.cnblogs.com/ruhuanxingyun/p/12741438.html
今日推荐