Wednesday, March 9, 2011

External Grails messages

Grails provides a simple way to put your gsp pages outside of the war file but I needed to be able to allow the messages to be customized as well. This is not well documented, but simple. Add this code to your resources.groovy file.

import org.springframework.context.support.ReloadableResourceBundleMessageSource


// Place your Spring DSL code here
beans = {


messageSource(ReloadableResourceBundleMessageSource){
basename="file:///usr/local/bluecat/portal/grails-app/i18n/messages"
}

}