简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM