[英]What does the scope attribute from the action tag of the struts-config file mean?
I'm working on a Struts application. 我正在开发一个Struts应用程序。
In order to edit the struts-config.xml
file, I think I have to add an attribute - scope
, in the action tag. 为了编辑
struts-config.xml
文件,我想我必须在action标签中添加一个属性 - scope
。 I'm not sure about its meaning, or its usage. 我不确定它的含义或用法。
<action path="/WetsVpnSwapTraffic"
type="com.kpn.bop.web.action.vpn.wets.WetsVpnSwapTraffic"
scope="request"
name="WetsVpnSwapTrafficForm"
roles="bop_wetsvpn_migrate"
validate="false">
<forward name="success" path="/WetsVpnSwapTrafficValidate.do"/>
<forward name="failure" path="/WetsVpnList.do"/>
</action>
Can anyone explain me if I have to put this attribute? 任何人都可以解释我是否必须提出这个属性?
The attribute scope
is used to define the scope (life of the object, the form) of the object action form that used in that action configuration. 属性
scope
用于定义在该操作配置中使用的对象操作表单的范围(对象的生命周期,表单)。
There's also different scopes, page
, request
, session
, application
. 还有不同的范围,
page
, request
, session
, application
。 That's all from servlet specs. 这些都来自servlet规范。 If you specify the scope of request that you want the form object is available during servlet http request.
如果指定要在servlet http请求期间表单对象可用的请求范围。
You can check this reference to determine how to use scopes. 您可以检查此参考以确定如何使用范围。
There's also link to action mapping configuration . 还有动作映射配置的链接。
它确定ActionForm
是否在请求或会话中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.