Spring中bean的做用域

Spring的做用域主要有四種:web 1)單例 (singleton):在整個應用中,只建立bean的一個實例。spring 2)原型 (prototype):每次注入或者經過spring上下文獲取的時候都會建立一個新的bean實例。session 3)會話 (session):在web應用中,爲每一個會話建立一個bean實例。prototype 4)請求 (request):在web應用中,爲
相關文章
相關標籤/搜索