当我重定向到同一控制器中的另一个动作时,'request'为空.
def updateEmployee() {
println "updateEmployee(): request =" + request.JSON
redirect(action: "createEmployee", params: params)
}
def createEmployee() {
def renderStatus = 500;
System.out.println "createEmployee() : request= " + request.JSON;
Run Code Online (Sandbox Code Playgroud)
updateEmployee打印所有请求数据,但creteEmployee将其打印为null([:])
如何重定向'请求'(我的意思是POST数据)?
您无法重定向POST请求.重定向意味着新的GET请求,因此先前请求的所有先前数据都将丢失.
如果您需要在没有实际重定向使用的情况下调用其他操作forward:http://grails.org/doc/latest/ref/Controllers/forward.html
| 归档时间: |
|
| 查看次数: |
872 次 |
| 最近记录: |