spring bean的默认作用域
时间: 2023-08-15 12:15:27 浏览: 110
spring的bean作用域
Spring Bean的默认作用域是singleton。当一个Bean的作用域为singleton时,Spring容器中只会存在一个共享的Bean实例,并且所有对Bean的请求,只要id与该Bean定义相匹配,就只会返回Bean的同一个实例。\[1\]\[2\]
#### 引用[.reference_title]
- *1* *3* [Spring中Bean的作用域](https://blog.csdn.net/unbelievevc/article/details/126259496)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Spring Bean的作用域](https://blog.csdn.net/weixin_42840266/article/details/109206747)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文