简体   繁体   English

struts-config文件的action标签的scope属性是什么意思?

[英]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 . 还有不同的范围, pagerequestsessionapplication 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.

相关问题 在Struts1的struts-config中提供操作参数值 - Providing action parameter value in struts-config in Struts1 如何在struts-config中的正向标记中添加自定义元素 - how to add custom elements in forward tag in struts-config struts-config.xml文件的action元素中scope属性可用的值 - how many values available for scope attribute in action element of struts-config.xml file 版本1.1中的struts-config中的通配符 - wildcard characters in struts-config, version 1.1 struts-config.xml中操作节点的“属性”属性有什么用? - What is the use of “attribute” attribute of action node in struts-config.xml? 如何访问Action中的动作标签(struts-config.xml)的路径属性或调度动作类? - How to access path attribute of action tag (struts-config.xml) in Action or dispatch action class? Struts 2中没有action属性的form标签的解决方法 - Solution for form tag without action attribute in Struts 2 Struts 1-通过一个帖子调用更多操作,而无需更改struts-config - Struts 1 - Calling more actions via one post without altering struts-config 元素类型“struts-config”的内容必须匹配“(datasource?,form-b​​eans? - The content of element type “struts-config” must match “(datasource?,form-beans? struts-config和message-resources:一种泛型或一种foreach语言 - struts-config and message-resources : one Generic or one foreach langage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM