可以設定為@Scope("request")、@Scope("prototype")等,預設為singleton

當Bean的scope為singleton時,一個IoC容器只會為這個Bean建立一個實例,

這個Bean實例會被存於快取中,之後對於這個Bean的請求或參照都會傳回同樣的Bean。

results matching ""

    No results matching ""