grails redirect code example
Example 1: redirect in grails
redirect(action: "update")
redirect(controller: "bookstore", action: "list")
redirect(controller: "bookstore", action: "list", namespace: "publishing")
redirect(controller: "bookstore", action: "list", plugin: "publishingUtils")
redirect(action: "show", id: 4, params: [author: "Stephen King"])
redirect(controller: "bookstore", action: "show", fragment: "profile")
redirect(uri: "bookstore/list")
redirect(url: "http://www.blogjava.net/BlueSUN")
redirect(Book.get(1))
Example 2: redirect in grails
class TestController {
def firstAction() {
redirect(action: "secondAction")
}
def secondAction() {
render "You were redirected from firstAction to secondAction"
}
}