Absolute reverse routing with Scala?

In game 1.X, you could get an absolute reverse routing URL using:

@@{MyController.method(param)} --> http://www.mydomain.com/myaction/param

instead of relative reverse routing with:

@{MyController.method(param)} --> /myaction/param

I am using play 2.0 with the scala version. I can get relative routes using:

@routes.MyController.method(param) --> /myaction/param

As "@@" just escapes the "@" reserved for scala statements, is it also possible to have absolute reverse routing? I can not find it in the API

+3
source share
1 answer

There is a method absoluteUrlfor obtaining an absolute address.

So:

@routes.MyController.method(param).absoluteURL()
+5
source

All Articles