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

mar*_*ieg 7 java struts scope struts-1 struts-config

我正在开发一个Struts应用程序.

为了编辑struts-config.xml文件,我想我必须scope在action标签中添加一个属性.我不确定它的含义或用法.

<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>  
Run Code Online (Sandbox Code Playgroud)

任何人都可以解释我是否必须提出这个属性?

Rom*_*n C 8

该属性scope用于定义在该操作配置中使用的对象操作表单的范围(对象的生命周期,表单).

还有不同的范围,page,request,session,application.这些都来自servlet规范.如果指定要在servlet http请求期间表单对象可用的请求范围.

您可以检查此参考以确定如何使用范围.

还有动作映射配置的链接.


Dav*_*ton 2

它确定是否ActionForm在请求或会话中。