I need to direct the user to another URL after the server has received some form data. How can I redirect the user in Play Framework?
I have tried with:
val url = "http://127.0.0.1:9000/user/" + user.id + "/" + user.name
response.setHeader("Location", url)
But the user is not redirected. With PHP I can do this using:
header('Location: http://127.0.0.1:9000/user/'.user->id.'/'.user->name);
I have tried to use Action(MyController.myMethod) but then is not the “preferred” URL used. How do I set a redirect header using Play Framework?
Why not simply use?