When creating a filter, I was unable to add additional methods to the filter class without getting the additional method reported as a problem.
Test case is as follows:
1. Setup a filters class as follows:
class SecurityFilters {
def filters = {
loginCheck(controller:'', action:'') {
before = {
Date now = getNow()
println "${now} before() called"
}
}
}
def getNow() {
println "Into getNow()"
return new Date()
}
}
2. Run grails run-app. You'll probably need to add some dummy controller to your project to trigger the filter.
3. Note in the output logging the following lines:
[18078] filters.FilterConfig Setting getNow is invalid for filter config getNow
Into getNow()
Fri Nov 09 14:48:55 CAT 2007 before() called
So even though getNow() is actually called, it seems, Grails is not altogether happy with the setup of the Filters class.