【发布时间】:2013-03-01 16:30:52
【问题描述】:
我在这里做错了什么,我无法将 JSON 对象 从 Grails 控制器 传递给 Grails 服务。 p>
class SampleController {
def sampleService
def updateProduct() {
def jq = request.JSON
sampleService(jq)
}
}
class SampleService {
def updateProduct (JSONObject requestJSON) {
if (!requestJSON) {
return null;
}
}
}
没有方法签名:com.SampleService.call() 适用于参数类型:(org.codehaus.groovy.grails.web.json.JSONObject) 值:
可能的解决方案:
wait()、any()、wait(long)、any(groovy.lang.Closure)、each(groovy.lang.Closure)、find()。
堆栈跟踪如下:
【问题讨论】:
-
你会发布堆栈跟踪吗?
-
错误 2013-03-01 10:15:45,056 [http-bio-8080-exec-4] 错误错误。GrailsExceptionResolver - 处理请求时发生 MissingMethodException:没有方法签名:com.SampleService。 call() 适用于参数类型:(org.codehaus.groovy.grails.web.json.JSONObject) 值:可能的解决方案:wait()、any()、wait(long)、any(groovy.lang.Closure) ,每个(groovy.lang.Closure),find()。堆栈跟踪如下:
-
我猜
sampleService(jq)应该是sampleService.updateProduct(jq)。