2017-10-12 83 views
0

拦截器通常带有matchAll/match匹配器。特别适用于比赛如何匹配Grails 3.2.x中控制器的action null拦截器

例如

match(controller: 'draws', action: 'index|details|prizeBreakdown') 

我的问题是,当我做一个GET到DrawsController,像

/draws 

动作名称是

null 

,因此我从来没有在

boolean before() 

到达如何配合这些要求?

谢谢。

P.S.我在使用jdk的Grails 3.2.7 8u144

回答

1

我会说这是一个错误。对付它的方法之一是这样的:

class SampleInterceptor { 

    SampleInterceptor() { 
     match controller: 'draws', action: 'index|details|prizeBreakdown' 
     match uri: '/draws' 
    } 

    boolean before() { 
     log.debug 'The before interceptor is executing' 
     true 
    } 
} 

如果您在https://github.com/grails/grails-core/issues文件中的问题,我们可以看看它。

对不起。

+0

我们开了一个新的问题https://github.com/grails/grails-core/issues/10831 – user2987581

+0

谢谢你打开这个问题。 –