Spring的作用域

1.Singleton作用域: 當一個bean的作用域爲singleton, 那麼Spring IoC容器中只會存在一個共享的bean實例,並且所有對bean的請求,只要id與該bean定義相匹配,則只會返回bean的同一實例。 Singleton作用域是Spring中的缺省作用域。要在XML中將bean定義成singleton,可以這樣配置: Xml代碼 <bean id="accountSer
相關文章
相關標籤/搜索