【发布时间】:2012-07-28 14:08:16
【问题描述】:
我在表单操作类中有一些代码需要从RequestContext 获取flowExecutionKey。我似乎找不到任何有关如何执行此操作的文档。我的班级看起来像这样:
public class MyFormAction extends FormAction
{
public Event doStuff(RequestContext context)
{
String flowExecutionKey = ...??
...
}
}
我知道我真的不需要获取 flowExecutionKey,但我正在处理一些需要它的遗留代码。此方法被称为视图状态的入口操作。我试过context.getFlowExecutionContext().getKey(),但它返回null。 context.getFlowExecutionUrl() 也返回 null。有没有办法做到这一点?
更新
我又在玩这个,context.getFlowExecutionContext().getKey() 在<on-render> 而不是<on-entry> 中调用该方法时确实获得了flowExecutionKey。还值得注意的是,它在<on-entry> 期间以稍后的视图状态工作。它不工作的视图状态是我流程中的第一个视图状态。是否有某些原因我无法在第一个视图状态下获得 <on-entry> 中的 flowExecutionKey?
【问题讨论】:
标签: spring spring-webflow