Java 通过动作链接在动作之间传递值

Java 通过动作链接在动作之间传递值,java,struts2,action,chaining,Java,Struts2,Action,Chaining,我有一颗这样的豆子 private String projectName; private String projectCode; <action name="displaySkillReport" class="com.ibm.succession.tool.actions.SkillTypeReportAction"> <result name="success">/skillTypeResoucePlan.jsp</result&g

我有一颗这样的豆子

private String projectName;
private String projectCode;
<action name="displaySkillReport"  class="com.ibm.succession.tool.actions.SkillTypeReportAction">
            <result name="success">/skillTypeResoucePlan.jsp</result>
        </action>
它包含有效的getter和setter

在我的Action类中,我将此作为列表返回,并进一步传递给JSP以显示

<select class="ibm-styled" name="selectedProjects" id="selectedProjects" 
        multiple="multiple"   tabindex="1"> 
    <s:iterator value="projectList">
        <option value="<s:property value='projectCode' />">
             <s:property value="projectName"/> 
        </option>
    </s:iterator>
</select> 
我测试了它,我能够从控制台上的action类打印它们。现在真正的问题来了……我需要通过动作链调用另一个动作,并传递它们的参数

<action name="reports" class="com.ibm.succession.tool.actions.Reports" method="generateReport">
            <result name="tsrep">/TenuredSummary.jsp</result>
            <result name="strprep" type="chain">
                <param name="actionName">displaySkillReport</param>
                <param name="selectedProjects">${selectedProjects}</param>
                <param name="selectedProjectName">${selectedProjectName}</param>
            </result>   
        </action>
但是当我尝试在那里使用它时,…selectedProjectName为空,但另一个工作正常


有没有人可以解释一下,如果需要更多详细信息,请告诉我。

如果您想在操作之间传递参数,而不是应该使用type=chain

对于Struts 2.2

对于Struts 2.0


如果这对您不起作用,也要发表评论。

它怎么可能是空白的,或者另一个工作正常?
<action name="displaySkillReport"  class="com.ibm.succession.tool.actions.SkillTypeReportAction">
            <result name="success">/skillTypeResoucePlan.jsp</result>
        </action>
private String selectedProjects = null;
    private String selectedProjectName= null;
   <action name="reports" class="com.ibm.succession.tool.actions.Reports" method="generateReport">
        <result name="tsrep">/TenuredSummary.jsp</result>
        <result name="strprep" type="redirectAction">
            <param name="actionName">displaySkillReport</param>
            <param name="selectedProjects">${selectedProjects}</param>
            <param name="selectedProjectName">${selectedProjectName}</param>
        </result>   
    </action>
 <result type="redirectAction">
 <result type="redirect-action">