2015-08-15 52 views
2

注意:第二個動作只允許POST方法。我們無法通過用戶執行該操作。如何使用發佈請求方法將一個動作重定向到另一個動作

static allowedMethods = [save: "POST",booked:"POST"] 

def save() 
{ 
// did save operation here 
redirect action:'booked' 
} 

def booked() 
{ 
//did the operation related with this 
render view :'payment' 
} 
+0

可能的重複http://stackoverflow.com/questions/9820797/how-to-redirect-to-an-external-url-using-post-in-grails –

+0

你究竟想要做什麼? – injecteer

回答

4

嘗試着傳遞給保存

def save() 
{// did save operation here 
forward action:'booked' 
} 

def booked() 
{ 
//did the operation related with this 
render view :'payment' 
} 

所有參數都將直接獲得通過,以如下做到這一點預訂方法。這是你需要的嗎?

0

您可以通過直接調用內的方法保存方法

def save(){ 
booked() 
} 
相關問題