[英]In Spring boot if a class is annotated with @component will it behave like singleton class?
當我們用@service 和@component 注釋類時,有人能解釋一下幕后發生了什么嗎?
@Component 創建一個類的單例 bean,它是可自動檢測和自動配置的類路徑掃描。
默認情況下,spring ApplicationContextContainer 在此處將其視為單例
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.