I suggest you define a separate action for an interceptor:
def beforeInterceptor = [action:this.&doBeforeStuff]
def doBeforeStuff() {
trimParams(params)
debug(params)
}
def trimParams() {
params?.each { it = it.toString().trim() }
}
def debug() {
log.info("${actionUri} with params ${params}")
}
I have not tried but can help.
source
share