In grails one defines spring beans in resources.groovy
using the spring groovy DSL
beans = {
myBean(MyBeanImpl) {
someProperty = 42
otherProperty = "blue"
bookService = ref("bookService")
}
}
How do you define prototype scoped bean using this DSL? I couldnt find anything on this in the documentation
This should work:
beans = {
myBean(MyBeanImpl) { bean ->
bean.scope = 'prototype'
someProperty = 42
otherProperty = "blue"
bookService = ref("bookService")
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With