当前位置:网站首页>@Resource和@Autowired的区别?
@Resource和@Autowired的区别?
2022-07-07 10:37:00 【泗水六年】
@Resource和@Autowired的区别?
@Autowired是Spring提供的注解,@Resource是JDK提供的注解。
@Autowired只能按类型注入,@Resource默认按照名称注入,也可以通过类型注入。
@Resource默认按照名称进行注入,如果注入失败的话会转为按类型进行注入,如果按类型也注入失败会抛出异常。
边栏推荐
猜你喜欢

数据库安全的重要性

BGP third experiment report

SQL Lab (32~35) contains the principle understanding and precautions of wide byte injection (continuously updated later)

Customize the web service configuration file

Attack and defense world ----- summary of web knowledge points

聊聊Redis缓存4种集群方案、及优缺点对比

Day-19 IO stream

Day-18 hash table, generic

SQL lab 21~25 summary (subsequent continuous update) (including secondary injection explanation)

Importance of database security
随机推荐
File upload vulnerability - upload labs (1~2)
Vxlan 静态集中网关
Configure an encrypted web server
Day-14 common APIs
leetcode刷题:二叉树19(合并二叉树)
2022聚合工艺考试题模拟考试题库及在线模拟考试
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
The road to success in R & D efficiency of 1000 person Internet companies
Experiment with a web server that configures its own content
NPM instal reports agent or network problems
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
BGP third experiment report
Simple implementation of call, bind and apply
数据库安全的重要性
Multi row and multi column flex layout
Error in compiling libssl
Tutorial on the principle and application of database system (011) -- relational database
Solutions to cross domain problems
Processing strategy of message queue message loss and repeated message sending
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作