I used to do this:
resources.groovy:
beans = {
envSettings(ConcurrentHashMap) {bean ->
/* k: String, v: String */
}
}
And then in BootStrap.groovy:
String label = grailsApplication.config.getProperty('envSettings.label', String, 'N/A')
Boolean nonProd = grailsApplication.config.getProperty('envSettings.nonProd', Boolean, true)
envSettings["label"] = label
envSettings["nonProd"] = nonProd
It looks like we can do that without BootStrap.groovy.
It's sooo simple.
resources.groovy:
beans = {
prefixDflt String, grailsApplication.config.getProperty("prefix.dflt", String, "")
}
No comments:
Post a Comment