开发者

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜