Bean scopes

Scope Description
singleton (默认的)每个String IoC容器作用域中一个bean定义只对应一个对象实例
prototype 一个bean定义对应多个对象实例
request 一个bean定义作用于HTTP request生命周期。仅在基于web的Spring ApplicationContext中有效
session 一个bean定义作用于HTTP session生命周期。仅在基于web的Spring Application中有效
global Session 一个bean定义于全局的HTTP session生命周期。仅在基于web的Spring ApplicationContext中有效
application 一个bean定义作用于全局的HTTP session生命周期。仅在基于web的Spring ApplicationContext中有效
websocket

ConfigurableBeanFactory.SCOPE_PROTOTYPE

ConfigurableBeanFactory.SCOPE_SINGLETON

WebApplicationContext.SCOPE_REQUEST

WebApplicationContext.SCOPE_SESSION

results matching ""

    No results matching ""