I am trying to access grailsApplication in groovy class under src/groovy but I get a null pointer exception. I also tried to inject a service into the same class and same result. How can I access grailsApplication or a service from groovy class? (I am using Grails 1.3.7)
I am trying to access grailsApplication in groovy class under src/groovy but I get
Share
Dependency injection does not work for groovy classes under
src/groovy. You can get the access tograilsApplicationusingApplicationHolderlike this:You can access all services like this: