Playframework: routes entry to an external URL
I want the following redirect开发者_如何学Goion functionality
GET /google google.com
How should I implement this?
It does not seem it is possible to do that straight from the routes files at this moment.
You could implement this in a controller:
public class Application extends Controller {
public static void google() {
redirect("http://www.google.com");
}
}
GET /google controllers.Default.redirect(to = "http://google.com/")
(Re-post of FoREacH's comment because it's worth being here as an answer)
精彩评论