Reputation: 91
I am new to play. I have a scenario like I need to redirect the request that I am getting to other url.
Can anyone help with sample code snippets with play apis that can be added in controllers class?
Upvotes: 2
Views: 571
Reputation: 3963
To redirect to the index page use this:
Redirect(routes.Application.index)
Complete Example:
def foo() = Action {
// handle your post-request stuff here....
// Forward to index page (or somewhere else...)
Redirect(routes.Application.index)
}
Upvotes: 2