Reputation: 29477
I have a Grails 2.4.4 app. In it I have the following controllers:
myapp/
grails-app/
controllers/
fizzbuzz/
FizzController.groovy
BuzzController.groovy
... many others, etc.
I want to create Grails Filters for some of these, so I create a grails-app/conf/WidgetFilters.groovy
class:
class WidgetFilters {
def filters = {
fizzFilter(controller: 'fizz*', action: '*') {
before = {
println 'I intercepted a called to the Fizz Controller!'
}
}
buzzFilter(controller: 'buzz*', action: '*') {
before = {
println 'I intercepted a called to the Buzz Controller!'
}
}
}
}
When I start my app up and go to any Fizz/Buzz actions, I do not see the println
. I've also tried other logging statements (SLF4J) and put other code inside the before
closure and am 100% convinced they are not executing. Have I done something obviously wrong?
Upvotes: 3
Views: 413
Reputation: 4177
Did you tried to restart app + clean build?
I've copy-pasted your filters and mock controllers and they're working, here is a code.
Please check out also this properties:
Upvotes: 2