当前位置:网站首页>@Resource和@Autowired的区别?
@Resource和@Autowired的区别?
2022-07-07 10:37:00 【泗水六年】
@Resource和@Autowired的区别?
@Autowired是Spring提供的注解,@Resource是JDK提供的注解。
@Autowired只能按类型注入,@Resource默认按照名称注入,也可以通过类型注入。
@Resource默认按照名称进行注入,如果注入失败的话会转为按类型进行注入,如果按类型也注入失败会抛出异常。
边栏推荐
猜你喜欢
Idea 2021 Chinese garbled code
The hoisting of the upper cylinder of the steel containment of the world's first reactor "linglong-1" reactor building was successful
What if does not match your user account appears when submitting the code?
Vxlan 静态集中网关
Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
idm服务器响应显示您没有权限下载解决教程
SQL Lab (46~53) (continuous update later) order by injection
The left-hand side of an assignment expression may not be an optional property access.ts(2779)
Routing strategy of multi-point republication [Huawei]
NPM instal reports agent or network problems
随机推荐
Guangzhou held work safety conference
Experiment with a web server that configures its own content
NGUI-UILabel
广州市召开安全生产工作会议
Customize the web service configuration file
Master公式。(用于计算递归的时间复杂度。)
2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
2022-07-07日报:GAN发明者Ian Goodfellow正式加入DeepMind
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
[deep learning] image multi label classification task, Baidu paddleclas
用mysql查询某字段是否有索引
SQL head injection -- injection principle and essence
Day-14 common APIs
SQL Lab (41~45) (continuous update later)
gcc 编译报错
Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
[statistical learning methods] learning notes - Chapter 4: naive Bayesian method
File upload vulnerability - upload labs (1~2)
Attack and defense world ----- summary of web knowledge points
Static routing assignment of network reachable and telent connections