Reputation: 1506
When I redirect to another action in the same controller the 'request' is null.
def updateEmployee() {
println "updateEmployee(): request =" + request.JSON
redirect(action: "createEmployee", params: params)
}
def createEmployee() {
def renderStatus = 500;
System.out.println "createEmployee() : request= " + request.JSON;
the updateEmployee prints all the request data, but creteEmployee prints it as null ([:])
How to redirect the 'request' (I mean the POST data ) ?
Upvotes: 2
Views: 1041
Reputation: 35961
You cannot redirect POST request. Redirect mean a new GET request, so all previous data from previous request will be lost.
If you need to call another action without actual redirect use forward
: http://grails.org/doc/latest/ref/Controllers/forward.html
Upvotes: 6