小菜鸟学 Spring-bean scope (一)
2024-10-18 18:22:12
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
最新文章
- GSM07.10协议中串口复用使用的校验算法
- SQLServer数据库中创建临时表
- 分享45个设计师应该见到的新鲜的Web移动设备用户界面PSD套件
- VS2010 需要缺少的web组件才能加载该项目
- 用C++进行函数式编程
- mysql数据类型介绍
- Tomcat部署多个项目及相关配置
- 浅谈IM软件业务知识——非对称加密,RSA算法,数字签名,公钥,私钥
- JS - JSON.stringify
- Android Material Design(一)史上最全的材料设计控件大全
- L1-Day12
- 用javascript写原生ajax(笔记)
- Java Insets获取窗口的顶、底、左、右的大小
- Learn how to use git
- latex中使用listings显示代码
- 在 Visual Studio 生成项目时,会发现一些 dll 并没有被复制到输出目录,导致最终程序的执行错误
- 并发编程---线程queue---进程池线程池---异部调用(回调机制)
- vi快捷键使用大全
- Maven for Eclipse 第三章 ——创建和导入 Maven 项目
- golang文件传输服务