I may not be understanding the core issue here, but the simple answer might be "they're already chained". Filters are executed based on the selector you put in the filter closure (e.g. myPreProcessorFilter(controller:'', action:'') {}). All selectors that match your controller/action will execute. I do this all the time with logging and performance measurement filters.
Here's an example. Both the logAction and measureMethodTime filters will be applied to all controllers and actions (since I left the selector wide open).
import org.springframework.web.context.request.RequestContextHolder as RCH
import com.x.y.*
class PerformanceFilters {
def filters = {
logAction(controller:'*', action:'*'){
before = {
log.debug("${controllerName}.${actionName}: entering; params=${params}")
}
}
measureMethodTime(controller:'*', action:'*'){
before = {
def session = RCH.currentRequestAttributes().getSession(false)
if (session)
{
Q.startTimer("${session.id}-${controllerName}-${actionName}", "method.${controllerName}.${actionName}")
}
}
afterView = {
def session = RCH.currentRequestAttributes().getSession(false)
if (session)
{
Q.stopTimer("${session.id}-${controllerName}-${actionName}", "method.${controllerName}.${actionName}")
}
}
}
}
}