当前位置:网站首页>@What is the difference between resource and @autowired?

@What is the difference between resource and @autowired?

2022-07-07 12:49:00 Six years of Surabaya

@Resource and @Autowired The difference between ?

@Autowired yes Spring Notes provided ,@Resource yes JDK Notes provided .

@Autowired Can only be injected by type ,@Resource By default, it is injected by name , You can also inject by type .

@Resource By default, it is injected by name , If the injection fails, it will be injected by type , If injection fails by type, an exception will be thrown .

原网站

版权声明
本文为[Six years of Surabaya]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071037184339.html