Search code examples
grailsgrails-controllergrails-filters

How to get controller class in grails filter


I need the class of the controllers that pass through a certain filter for annotation processing pruposes.

Currently I can only see the controllerName.

Is there anyway of getting the actual controller.class?


Solution

  • Take a look at the documentation and you will see that you have access to the controller name in controllerName and many other values.

    If you need the entire class name you can find it through:

    grailsApplication.getArtefactByLogicalPropertyName("Controller", controllerName).clazz