On 18/03/2011 21:18, Reese, Nathan wrote:
> Is it possible to load an external BootStrap.groovy file? I know how to
> load external property files, but can not find any documentation on how
> to load an external BootStrap.groovy file. I want to be able to
> externally initialize domain objects for many different production
> environments.
Not directly, but since you can have external .groovy *config* files the
easiest approach is to say something like this in BootStrap.groovy:
def extraBootStrap = grailsApplication.config.myapp.extraBootStrap
if(extraBootStrap) {
extraBootStrap.call(servletContext)
}
Then in a grails.config.locations external .groovy config file you can say
myapp {
extraBootStrap = { servletContext ->
// put your bootstrap code here
}
}
Ian
--
Ian Roberts | Department of Computer Science
[hidden email] | University of Sheffield, UK
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email