嗯,它是一個有點,因爲我做了一個流程,你的例子是簡單的(僅僅因爲是一個例子的緣故,我希望)。
你缺少的是流程中的初始操作。請記住,showProducts的「視圖」流動操作只是說明在showProducts gsp POSTS時該怎麼做。它在showProducts.gsp
def ShoppingCartFlow = {
initialize {
action { // note this is an ACTION flow task
// perform some code
[ model: modelInstance ] // this model will be used in showProducts.gsp
}
on ("success").to "showProducts"
// it's the above line that sends you to showProducts.gsp
}
showProducts {
// note lack of action{} means this is a VIEW flow task
// you'll get here when you click an action button from showProducts.gsp
on("checkout").to "enterPersonalDetails"
on("continueShopping").to "displayCatalogue"
}
// etc. (you'll need an enterPersonalDetails task,
// displayCatalogue task, and they
// should both be ACTION tasks)
}
有意義用來發送您應該創建模型展示Products行動?
這不是一個正常的控制器操作,它是一個web-flow狀態。我不確定渲染方法可以像你在視圖狀態下所建議的那樣使用。 – 2009-06-17 12:49:20