Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the scope attribute from the action tag of the struts-config file mean?

I'm working on a Struts application.

In order to edit the struts-config.xml file, I think I have to add an attribute - scope, in the action tag. 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?

like image 890
marlieg Avatar asked Feb 21 '13 09:02

marlieg


1 Answers

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.

There's also different scopes, page, request, session, application. That's all from servlet specs. If you specify the scope of request that you want the form object is available during servlet http request.

You can check this reference to determine how to use scopes.

There's also link to action mapping configuration.

like image 99
Roman C Avatar answered Nov 15 '22 17:11

Roman C