简体   繁体   English

Grails 2.0.0.M1中的异步功能

[英]Async-feature in grails 2.0.0.M1

i am trying out the async-feature in grails. 我正在尝试grails中的异步功能。 According to http://grails.org/doc/2.0.0.M1/guide/introduction.html#webFeatures it is now possible to use the servlet 3.0 async-feature in grails. 根据http://grails.org/doc/2.0.0.M1/guide/introduction.html#webFeatures ,现在可以在grails中使用servlet 3.0异步功能。 So i tried the following code (copied from the doc): 所以我尝试了以下代码(从文档复制):

def index() {
    def ctx = startAsync()
    ctx.start {
        render "hello"
        ctx.complete()
    }
}

just to see if it works, sadly it does not work :/. 只看它是否有效,可惜它不起作用:/。 A groovy.lang.MissingMethodException is thrown. 引发groovy.lang.MissingMethodException。 Message: No signature of method: grailsasync.ProductController.startAsync() is applicable for argument types: () values: []. 消息:没有方法签名:grailsasync.ProductController.startAsync()适用于参数类型:()值:[]。 While compiling i get no errors, only while executing. 编译时我没有错误,只有执行时才出错。

So i ask myself what did i do wrong? 所以我问自己我做错了什么? Maybe someone has tried out the new Milestone of grails and can help me with that. 也许有人尝试了grails的新里程碑,并可以帮助我。

gz Aleks gz Aleks

Your code looks fine. 您的代码看起来不错。 Assuming you've already confirmed that you're running this on a container that supports v 3.0 of the Servlet specification, I'd create an issue about this in the Grails JIRA 假设您已经确认您正在支持Servlet规范v 3.0的容器上运行此代码,那么我将在Grails JIRA中创建与此相关的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM