Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Grails Web流插件-在子流中使用时流上下文丢失_Java_Spring_Grails_Groovy_Spring Webflow - Fatal编程技术网

Java Grails Web流插件-在子流中使用时流上下文丢失

Java Grails Web流插件-在子流中使用时流上下文丢失,java,spring,grails,groovy,spring-webflow,Java,Spring,Grails,Groovy,Spring Webflow,在下面的示例中,我请求test/first。当到达firstSubFlow时,我在流和对话上下文中保存一些变量。在showSomeView gsp中,我显示了这些变量,但似乎只有存储在对话上下文中的变量仍然可用。流上下文中存储的值为空 此问题仅在使用子流时出现。我正在使用Grails2.3.11和WebFlow插件2.0.8.1版 TestController.groovy showSomeView.gsp 如我们所见,另一个testvalue变量为空。我还提交了一期Jira,并附上了一个G

在下面的示例中,我请求test/first。当到达firstSubFlow时,我在流和对话上下文中保存一些变量。在showSomeView gsp中,我显示了这些变量,但似乎只有存储在对话上下文中的变量仍然可用。流上下文中存储的值为空

此问题仅在使用子流时出现。我正在使用Grails2.3.11和WebFlow插件2.0.8.1版

TestController.groovy

showSomeView.gsp

如我们所见,另一个testvalue变量为空。我还提交了一期Jira,并附上了一个Grails项目,重现了完全相同的错误:

是不是我做错了什么?任何帮助都将不胜感激

谢谢你,

Radu

对不起,上面的代码有一个输入错误。我拼错了flow.anotherTestvalue。它实际上是flow.anotherTestValue,值为大写V。现在一切正常

class TestController {

    def firstFlow = {
        start {
            action {
                flow.testValue = 'first flow Flow Scope';
                conversation.conversationTestValue = 'first flow Conversation Scope'
                gotoFirstSub()
            }

            on("gotoFirstSub") {}.to "firstSub"
        }

        firstSub {
            subflow(firstSubFlow)
            on("done") {}.to "done"
        }

        done {}

    }

    def firstSubFlow = {
        start {
            action {
                flow.anotherTestvalue = 'subflow Flow Scope'
                conversation.conversationAnotherTestValue = 'subflow Conversation Scope'
                gotoShowSomeView();
            }

            on('gotoShowSomeView') {}.to 'showSomeView'
        }

        showSomeView {
            on('next') {}.to 'done'
        }

        done()
    }
}
<html>
<head>
    <title>Flow context lost when used in a subflow</title>
</head>
<body>
Value from main flow scope: ${testValue}<br/>
Value from main flow conversation scope: ${conversationTestValue}<br/>
Value from subflow flow scope: ${anotherTestValue}<br/>
Value from subflow conversation scope: ${conversationAnotherTestValue}
</body>
</html>
Value from main flow scope:
Value from main flow conversation scope: first flow Conversation Scope
Value from subflow flow scope:
Value from subflow conversation scope: subflow Conversation Scope