任何人都可以描述一下我的对象吗?ActionMapper
, ActionProxy
, ActionInvocation
, ActionContext
在 Struts2 应用程序中创建。由于我是 Struts2 框架的新手,我对这些对象的范围感到非常困惑。
The ActionMapper http://struts.apache.org/maven/struts2-core/apidocs/org/apache/struts2/dispatcher/mapper/ActionMapper.html在启动时创建,它具有单例范围。
The ActionContext http://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionContext.html是由Dispatcher http://struts.apache.org/maven/struts2-core/apidocs/org/apache/struts2/dispatcher/Dispatcher.html在准备要执行的操作时,它是线程局部 https://docs.oracle.com/javase/7/docs/api/java/lang/ThreadLocal.html,并且它没有任何范围。
当动作执行时ActionInvocation http://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionInvocation.html and ActionProxy http://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionProxy.html创建的也没有范围。
你可以在一张大图 http://struts.apache.org/core-developers/big-picture.htmlStruts2架构。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)