首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

当Spring治理Struts2时配置的scope="prototype"

2012-11-15 
当Spring管理Struts2时配置的scopeprototypeSpringscopeprototype spring 默认scope 是单例模式 sco

当Spring管理Struts2时配置的scope="prototype"
Spring  scope="prototype"

spring 默认scope 是单例模式 scope="singleton"
这样只会创建一个Action对象
每次访问都是同一个Action对象,数据不安全
struts2 是要求 每次次访问 都对应不同的Action
scope="prototype" 可以保证 当有请求的时候 都创建一个Action对象




参考:
1.线程安全:http://guo2168.iteye.com/blog/859067
2.http://yzmduncan.iteye.com/blog/789162
3.http://blog.csdn.net/gaoge19861207/article/details/4745830

热点排行