【问题标题】:Spring WebFlow: What can i do with flow outcome?Spring WebFlow:我可以用流结果做什么?
【发布时间】:2016-07-13 22:17:39
【问题描述】:

我正在阅读 Spring WebFlow 文档,但我不明白我可以用 outcome 流结束状态的值做什么。你能给我看一些实际的例子吗?我想知道如何将结果变量传递给 MVC 控制器或其他流程,但不知道如何。

<flow>
    <end-state id="test2">
          <output name="id" value="123" />
    </end-state>
</flow>

【问题讨论】:

    标签: spring-webflow


    【解决方案1】:

    您可以使用 currentEvent.attributes(在您的示例中)从父流(如果您调用了子流)访问您的输出变量:

    currentEvent.attributes.id
    

    3.10 Calling Subflows部分

    您还可以通过实现handleExecutionOutcome 方法以编程方式在FlowHandler 中获取它们。 11.4 Implementing custom FlowHandlers 的“Example FlowHandler”部分下的文档中有一个示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-10
      • 2011-02-25
      相关资源
      最近更新 更多