是否可以将 Spring bean 注入(inject) Grails webflow?我尝试了以下
class CheckoutController {
ShoppingService shoppingService
def checkoutFlow = {
start {
action {
// This attempt to access the service doesn't work
flow.addresses = shoppingService.getOrder()
}
}
}
}
我可以访问
shoppingService
从常规 Controller 操作,但我无法从 webflow 的操作访问它(见上文)。
最佳答案
将以下内容添加到您的 Controller :
def transient shoppingService
关于grails - 依赖注入(inject) Grails Webflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7306519/