簡體   English   中英

AfterInterceptor在Grails 3.0.1中不再起作用

[英]AfterInterceptor does not work in Grails 3.0.1 anymore

我注意到afterinterceptor在Grails 3.0.1控制器中不再起作用。 相同的代碼在Grails 2.4.4中有效。 這是我的控制器代碼:

class TestAfterInterceptController {

    def afterInterceptor = { model, modelAndView ->
        println "##################################################"
        println "Current view is ${modelAndView.viewName}"
    }

    def index() {
        println "##################################################"
        render 'Hello world'
    }
}

當我使用http:// localhost:8080 / testAfterIntercept調用控制器時,它完全忽略了after攔截器方法,並且僅打印index()方法中的內容。

由於我們具有新的Interceptor類型,因此在Grails 3.0中尚未實現控制器級別的攔截Interceptor 參見http://grails.github.io/grails-doc/latest/guide/theWebLayer.html#interceptors

如果有足夠的需求,我們將恢復控制器級別的攔截器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM