For the latest version of grails (3.x as time of writing) it would be better to use traits instead of extending the abstract controller or using Mixin, it was later deprecated since the introduction of traits in groovy v2.3, here is an example of using a trait to add general behavior to your to the controller: 1- create your own traits in src / groovy, for example.
import grails.web.Action trait GenericController { @Action def test(){ render "${params}" } }
2- implement your attribute when implementing any interface:
class PersonController implements GenericController { }
Note. Traits can dynamically access all objects of the controller: params, response ... etc., and you can still override the action of signs.
I hope for this help.
source share