数据加载中……
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 当扎瓦 阅读(1949) 评论(1)  编辑  收藏 所属分类: SpringStruts

评论

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

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

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


网站导航: