Tuesday, January 11, 2011

Configuration properties in resources.groovy

In Grails there is support for property placeholders in resources.xml, but for resources.groovy you should do it manually. Fortunately, it is quite easy, here is example:

import org.codehaus.groovy.grails.commons.ConfigurationHolder as CH

beans = {
  integration.channel(id:'channel', host:'imaps://user:${CH.config.imap.password}@imap.gmail.com/INBOX')
}

No comments:

Post a Comment