简体   繁体   English

如何在struts-config中的正向标记中添加自定义元素

[英]how to add custom elements in forward tag in struts-config

I am new to struts 1.xi have used struts forward tag in my application like this 我是struts 1.xi的新手,在我的应用程序中像这样使用了struts forward标签

<struts-config>

<action-mappings>

    <action
        path="/Welcome"
        type="org.apache.struts.actions.ForwardAction"
        parameter="/pages/Welcome.jsp"/>

</action-mappings>

but in an application i am watching this approach 但在应用程序中,我正在观察这种方法

<action path="/getUserGrp" type="org.apache.struts.actions.ForwardAction"
        className="com.mj.metal.mapping.AutoActionMapping" parameter="/getUserGrp.screen">
        <set-property property="requireSignIn" value="true" />
        <forward name="requireSignIn" path="/getSignIn.do" />
        <forward name="failure" path="/errorHome.screen" />
        <forward name="invalidAccess" path="/underPrivileged.screen" />
    </action>

why className is used with forward action? 为什么将className与正向动作一起使用? and parameter is generally a method name like mapping dispatch. 参数通常是方法名称,例如映射调度。 Can anyone explain the meaning of this tag? 谁能解释这个标签的含义?

The clasName attribute is optional and is used if you've created your own custom ActionMapping class. clasName属性是可选的,如果您创建了自己的自定义ActionMapping类,则可以使用该属性。

The set-property element is used to initialize the properties in your custom ActionMapping class. set-property元素用于初始化自定义ActionMapping类中的属性。

Read this for more info 阅读以获得更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM