this information below just for study record of mine.
默认情况下:Spring 创建singleton bean 以便于错误能够被发现。
延迟加载:延迟加载可以使bean 在被需要的时候实例化
Bean Scope
singleton : Scopes
a single bean definition to a single object instance per Spring IoC container.
a single bean definition to a single object instance per Spring IoC container.
To put it another way, when
you define a bean definition and it is scoped as a singleton, the Spring IoC container creates exactly one instance
of the object defined by that bean definition. This single instance is stored in a cache of such singleton beans, and all
subsequent requests and references for that named bean return the cached object.
you define a bean definition and it is scoped as a singleton, the Spring IoC container creates exactly one instance
of the object defined by that bean definition. This single instance is stored in a cache of such singleton beans, and all
subsequent requests and references for that named bean return the cached object.
prototype: Scopes
a single bean definition to any number of object instances
a single bean definition to any number of object instances
request:
Scopes a single bean definition to the lifecycle of a single HTTP request
Scopes a single bean definition to the lifecycle of a single HTTP request
global
session:
Scopes a single bean definition to the lifecycle of a global HTTP Session
this come from http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/beans.html#beans-factory-scopes
if there are some copyright or problem happened ,please contact me.
zbwork000@163.com