Redirecting to an internal URL seems to be possible by using the redirect() method in the controller.
public static Result index() {
return redirect(routes.Application.tasks());
}
However I want to redirect to an external URL in the controller. redirect(String) method accepts only internal URLs as parameter.
What I require is Play framework equivalent of standard Java servlet redirect i.e.
request.sendRedirect(String url)
Sometimes simplest solution just… works:
It’s also worth to use other availabe redirects such as
seeOther(String url)movedPermanently(String url)temporaryRedirect(String url)etc