<2008年8月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

统计

  • 随笔 - 20
  • 文章 - 3
  • 评论 - 8
  • 引用 - 0

常用链接

留言簿(2)

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

struts中Action是非线程安全的!

struts的action是非线程安全的。
不要在action中定义实例变量。


在spring的配置文件中,可以配置action为线程安全,即每次调用都生成一个新的实例,而不是只用一个实例。
bean中设置singleton="true"

<bean id="/itemDayAction" class="com.joyinter.skype.statistic.action.ItemDayAction" singleton="true">
    
<property name="itemDayBO">
        
<ref bean="itemDayBO"/>
    
</property>
        
<property name="avatarItemBO">
        
<ref bean="avatarItemBO"/>
    
</property>
</bean>

posted on 2007-08-15 15:24 当扎瓦 阅读(1956) 评论(1)  编辑  收藏 所属分类: SpringStruts

评论

# re: struts中Action是非线程安全的! 2008-08-27 23:59 guest

singleton默认就是true的啊
  回复  更多评论    

只有注册用户登录后才能发表评论。


网站导航: