Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Struts 1 在struts-config.xml中,操作有一个;属性";属性。什么';它是干什么的?_Struts 1_Struts Config - Fatal编程技术网

Struts 1 在struts-config.xml中,操作有一个;属性";属性。什么';它是干什么的?

Struts 1 在struts-config.xml中,操作有一个;属性";属性。什么';它是干什么的?,struts-1,struts-config,Struts 1,Struts Config,在我们的web应用程序的struts-config.xml文件中,定义了大量的s,它们在大多数文件上都有名称和属性属性,两个文件中都有表单名称。例如: <action attribute="LoginForm" <-- this line name="LoginForm" path="/welcome" type="com.foo.presentation.action.LandingActionPre"> <forward na

在我们的web应用程序的struts-config.xml文件中,定义了大量的
s,它们在大多数文件上都有
名称
属性
属性,两个文件中都有表单名称。例如:

<action
    attribute="LoginForm"  <-- this line
    name="LoginForm"
    path="/welcome"
    type="com.foo.presentation.action.LandingActionPre">
    <forward name="SUCCESS" path="landing.welcome" />
    <forward name="ALREADY_LOGGED_IN" path="/landing.do?m=getLandingPage" redirect="true"/>
</action>
根据,它被用作ActionForm的一种别名

如果它与
名称
相同,则不起任何作用。但是如果指定了
名称
,并且指定了
属性
,并且与
名称
不同,则可以使用
名称
属性
的值来访问表单

相关章节:

<!-- The "action" element describes an ActionMapping object that is to be used
    to process a request for a specific module-relative URI. The following
    attributes are defined:

    attribute       Name of the request-scope or session-scope attribute that
                    is used to access our ActionForm bean, if it is other than
                    the bean's specified "name". Optional if "name" is specified,
                    else not valid.

我从未听说过这个属性。如果省略它会有区别吗?好吧,我有一个
,它在
属性
名称
中具有不同的形式名称,并且使用了
名称
一个。所以我想不是。[编辑:]如果我删除它,似乎什么都不会发生,好的或坏的。所以可能就像你说的,每个人都只是为了安全起见复制并粘贴了它。。。还有文件。