在Struts1中的struts-config中提供动作参数值

时间:2012-08-03 05:58:13

标签: java java-ee struts1

就像在Struts2中一样,我们可以在struts.xml中提供一个参数值,如下所示

<action name="myS2Action" class="demo.myS2Action">
    <result>/myS2Page.jsp</result>
    <param name="myS2Param">value</param>
</action>

在Struts1中,有没有办法在struts-config.xml中设置一些参数值?

我在struts-config.xml

中有以下条目
<form-bean name="myS1Form" type="demo.MyS1Form"></form-bean>
<action path="/myS1Action" type="demo.myS1Action" name="myS1Form" scope="request" >
    <forward name="success" path="/myS1Page.jsp"></forward>
</action>

1 个答案:

答案 0 :(得分:1)

在Strut1配置中,我们可以使用set-property标记。以下问题与set-property代码的使用有关。

In Struts1, how to use set-property tag inside action tag?