gpt4 book ai didi

grails - 首次访问时出现Grails Webflow错误

转载 作者:行者123 更新时间:2023-12-02 14:09:43 26 4
gpt4 key购买 nike

我在Grails中开发了一个简单的webflow(主要是尝试使用webflow,在这种情况下有点过头了)。在对Serializable对象进行了一些试验和磨难之后,我可以使它工作-有时。

这是麻烦的-在启动应用程序(运行应用程序)后,我第一次访问网络流时,出现此异常:

2010-06-16 09:11:25,580 [http-8080-3] [ERROR] [org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver] No signature of method: groovy.lang.MissingMethodException.to() is applicable for argument types: (java.lang.String) values: [validate]
Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), getAt(java.lang.String), with(groovy.lang.Closure), any(groovy.lang.Closure)
groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.to() is applicable for argument types: (java.lang.String) values: [validate]
Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), getAt(java.lang.String), with(groovy.lang.Closure), any(groovy.lang.Closure)
at com.sbs.component.survey.SurveyDefinitionController.invokeMethod(SurveyDefinitionController.groovy)
at com.sbs.component.survey.SurveyDefinitionController$_closure3.doCall(SurveyDefinitionController.groovy:23)

如果我“触摸” Controller (进行任何编辑,即使只是添加空白),然后保存文件,Webflow就会开始工作……似乎直到 Controller 至少重新加载一次之后,东西才开始连接起来。显然这是一个初学者...任何想法是什么原因造成的?

我在Mac OSX Java 1.6上使用Grails 1.3.1。

这是Webflow的框架:
def createSurveyFlow = {
select {

}.to("validate")
on("cancel").to("finish")
}

validate {
on("approve") {

}.to("finish")
on("disapprove").to("select")
on("cancel").to("finish")
}

finish {
action {
flash.message = "SurveyDefinition created"
}
redirect(controller:"surveyDefinition", action:"index")
}

}

最佳答案

我可能已经弄清楚了-似乎Webflow定义和 Controller 操作与位于同一 Controller 上不太像。当我将Webflow移到它自己的 Controller 时,这个(和其他)问题似乎消失了。至少现在。如果/当我了解更多信息时,我会报告。

关于grails - 首次访问时出现Grails Webflow错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3054810/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com