isn’t config a property on grailsApplication? doe...
# questions
j
isn’t config a property on grailsApplication? does it work if you change [‘config’] to .config ?
g
Thanks for help. Yes, It worked. Seemed I have to do this way.
Copy code
String defaultSchoolName = grailsApplication.getConfig().get('my.own.property')
Another thing i noticed is the jsonObject parsed by JsonSlupper, the old map way stopped compiling. I have to use jsonObj.get('someNode').get('childrenNode'). In existing code, I just do jsonObj['abc']?.['efg']?.... I wonder why Groovy 4 does not allow these type grammar sugars. I personally like them.
m
I think this blog post explains the best practices regarding retrieving config values well: https://grails.apache.org/blog/2016-08-31.html
There is also a "Grails Quickcast" about it:

https://www.youtube.com/watch?v=Qw5hjwT9EOc

🙏 1