strutsa的action是单例模式吗??
strutsa?您要说的是不是: struts
struts2应该是线程安全的,action不是单例
struts1的action是单例模式
struts2的action不是
http://java.e800.com.cn/articles/2009/319/1237434188417_1.html
Struts2中使用的action从上往下是这样的:
1.ActionSupport实现自Action接口, Action是一个接口类,仅包含execute方法。
2.ActionSupport类为大部分actions提供了一些默认的方法。其他自定义的action需要继承此类来使用。
从上面看, Struts2的Action是非单例的。
单例类的使用场景是让系统中仅存在一份某类的实例,并且唯一的。
[url]http://www.iteye.com/problems/7870[/url]
看这里
鄙视发帖前不GOOGLE的。