通过控制器中的redirect()方法似乎可以将页面重定向到内部URL。
public static Result index() {
return redirect(routes.Application.tasks());
}
然而,我希望在控制器中重定向到外部URL。redirect(String)方法只接受内部URL作为参数。
我需要Play框架等同于标准Java servlet重定向的方法:
request.sendRedirect(String url)
通过控制器中的redirect()方法似乎可以将页面重定向到内部URL。
public static Result index() {
return redirect(routes.Application.tasks());
}
然而,我希望在控制器中重定向到外部URL。redirect(String)方法只接受内部URL作为参数。
我需要Play框架等同于标准Java servlet重定向的方法:
request.sendRedirect(String url)
redirect(String)
给了我这个错误 -Execution exception [StackOverflowError: null]
。 - Manish SinghString url="http://domain.tld"; return seeOther(url);
或者return seeOther("http://domain.tld");
。 - biesior