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)
After Grails 2.0, you should use:
def grailsApplication = Holders.grailsApplication
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With