Grails Web Flow的第一个状态 [英] Grails Web Flow first state
问题描述
- 是否可以有多个启动状态? >
- 第一个状态有可能是一个动作状态吗?
- 假设(2)的答案是否定的,我有什么选择将数据传递给第一个(视图)状态?我可以事先将它存储在会话中,但这不是很有吸引力,因为我需要自己去处理它。理想情况下,我希望在显示第一个(视图)状态之前将数据存储在流程范围中,但我不明白这是如何实现的。
def createNewSubscriptionFlow = {
initialState {
action {
...
然后在您声明时抓取您需要的数据并将其存储在流程范围中(需要可序列化!)。 / p>
在回答1时,我不认为您可以拥有多个启动状态,但您可以让您的初始操作状态决定要转移到的状态。
谢谢, A few questions about the first state of a Grails web flow:
You can have an action state as the first state in a webflow and you can pass parameters in to it as any other controller action and get them with 'params.paramName'. Then grab the data you need and store in flow scope(Needs to be serializable!) as you state. In answer to 1, I don't think you can have multiple start states but you could make your initial action state decide what state to move to. Thanks, Jim. 这篇关于Grails Web Flow的第一个状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
def createNewSubscriptionFlow= {
initialState {
action {
...