参考链接:
http://caohongxing7604.blog.163.com/blog/static/32016974200842933949179/
总结:
struts2:是struts1和webWork的整合。其核心设计思想来自webWork(可以认为是webWork的升级)
struts2开发表现上:
表单:struts2的表单<s:form method="post" name="frm" id="queryWorkAreaForm" >
action类:action类不用实现struts的action类
请求与action类配置:方式1=struts.xml ;方式2=注解@(注解是应用spring 的IOC功能)
struts1 :action类是单例模式,生命周期中只有一个实例,且线程安全。
struts2: action类为每个请求生成一个实例。
线程模式方面:
Struts1 Action是单例模式并且必须是线程安全的,因为仅有Action的一个实例来处理所有的请求。单例策略限制了Struts1 Action能做的事,并且要在开发时特别小心。Action资源必须是线程安全的或同步的;Struts2 Action对象为每一个请求产生一个实例,因此没有线程安全问题。