issue getting dynamic Config parameter in Grails taglib
- by Mick Knutson
I have a dynamic config parameter I want to get like:
String srcProperty = "${attrs ['src']}.audio" + ((attrs['locale'])? "_${attrs['locale']}" : '')
assert srcProperty == "prompt.welcomeMessageOverrideGreeting.audio"
where my config has:
prompt{
welcomeMessageOverrideGreeting {
audio = "/en/someFileName.wav"
txt = "Text alternative for /en/someFileName.wav"
audio_es = "/es/promptFileName.wav"
txt_es = "Texto alternativo para /es/someFileName.wav"
}
}
While this works fine:
String audio = "${config.prompt.welcomeMessageOverrideGreeting.audio}"
and:
assert "${config.prompt.welcomeMessageOverrideGreeting.audio}" == "/en/someFileName.wav"
I can not get this to work:
String audio = config.getProperty("prompt.welcomeMessageOverrideGreeting.audio")