2010-06-16 63 views
2

我在Grails中开发了一个简单的webflow(主要是为了试验使用webflows--对于这种情况有点矫枉过正)。在使用Serializable对象进行一些试验和磨难之后,我有时会这么做。第一次访问Grails Webflow错误

这里是第一次rub-我启动应用程序(运行程序)之后访问的Webflow,我得到这个异常:

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) 

如果我“触摸”控制器(做任何编辑,甚至如果只是添加一个空格)然后保存该文件,webflow就会开始工作......看起来有些东西没有连接起来,直到控制器重新加载至少一次。显然,这是一个非首发......任何想法是什么造成这种情况?

我在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") 
     } 

    } 

回答

1

我可能已经想通OUT-似乎指出,Webflow的定义和控制器动作不太喜欢被同一个控制器上。当我将webflow移动到它自己的控制器时,这个(和其他)问题似乎消失了。至少现在,至少。当我学习更多时,我会回报。