如何保存用户访问的最后一个 spring-webflow 视图状态 id?
我有一个电子学习应用程序,有很多流程,有 10 个或更多页面。现在我得到的任务是,如果用户在完成流程之前退出,则可以返回到流程的最后访问页面。 因此,我必须在每个视图状态上保存输入 ID,但我不想手动更改每个视图状态定义。
我研究了流继承,但我必须至少更改每个子视图状态定义以从父视图状态继承。
我想到了 AOP 技术,但我不知道该把切入点放在哪里。
还有其他想法吗?
非常感谢, 拿但业
I have an e-learning application with many flows with 10 and more pages. Now I got the task that the user can return to the last visited page of a flow, if he drops out before finishing the flow.
So I have to save on every view-state the id on-entry but I don't want to change every view-state definition manually.
I looked at flow inheritance but then I must at least change every child view-state definition to inherit from a parent view state.
I thought of AOP technique but I don't know where I to put the pointcut.
Any other ideas?
Many Thanks,
Nathanael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我完全理解你的问题,一个例子可能会有所帮助。
无论哪种方式,您都应该查看 FlowExecutionListener 接口和/或 FlowExecutionListenerAdapter。创建一个实现(或扩展)其中之一的类将为您提供流程执行生命周期的挂钩。 stateEntered(...) 方法将在转换完成后触发,使您可以访问先前的状态和新的状态。在这里,您可以将先前的状态 ID 保存在流上下文中或持久存储中。
I am not sure I understand your question completely, an example may help.
Either way, you should take a look at the FlowExecutionListener interface and/or the FlowExecutionListenerAdapter. Creating a class that implements (or extends) one of these will give you hooks into the flow execution lifecycle. The stateEntered(...) method will fire after a transition has completed, giving you access to both the previous state and the new state. Here you could save off the previous state id, either on the flow context, or in a persistent store.