On 20/07/2012 13:23, Dennie.nl wrote:
> Hello,
> I've created an entity in my plugin which I want to wire into spring
> and initialize with the grailsApplication, but I can't get it to function.
> The bean gets initialized and is available but grailsApplication is null.
> Any ideas how to accomplish this?
There's two ways to do it. Either wire it in explicitly using ref:
def doWithSpring = {
smartServerConfig(SmartServerConfig){
grailsApplication = ref('grailsApplication')
}
}
or enable autowiring by name (which is what services, controllers, etc. use)
def doWithSpring = {
smartServerConfig(SmartServerConfig) { bean ->
bean.autowire = "byName"
}
}
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