Spring中Bean的生命週期和作用域

Spring中Bean的生命週期和作用域 在bean聲明時它有一個scope屬性,它是用於描述bean的作用域。 可取值有:          singleton:單例 代表在spring ioc容器中只有一個Bean實例 (默認的scope)          prototype多例 每一次從spring容器中獲取時,都會返回一個新的實例          request用在web開發中,將be
相關文章
相關標籤/搜索