Another option, if you do not want to use autowire by type through the entire controller and do not want to add a custom bean for some reason, then add a simple method for your controllers where you need services, for example:
def someServiceWithAReallyLongNameICannotChange def getSS() { someServiceWithAReallyLongNameICannotChange }
You can then refer to the service using ss.someMethod() anywhere in this controller.
However, this still requires adding a piece of code for each controller that you use this service, or you will have inconsistent naming of the service.
(Personally, I think the doelleri method is the best, as it allows you to be consistent in naming without changing individual classes.)
source share