Grails 如何使用post请求方法将一个操作重定向到另一个操作

Grails 如何使用post请求方法将一个操作重定向到另一个操作,grails,Grails,注意:第二个操作只允许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' } 您可以通过在save方法中直接调用方

注意:第二个操作只允许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'
}

您可以通过在save方法中直接调用方法来执行以下操作

def save(){
booked()
}
尝试前进

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

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

传递给save的所有参数将直接传递给booked方法。这就是你所需要的吗?

可能与你想做的事情重复?