I'd like to get the absolute URL from a controller in Play 2 Java. I found the exact same question for Scala, but I can't make it work in Java.
public class MyController extends Controller {
public static Result myMethod() {
return ok();
}
public static Result test() {
Logger.info(routes.MyController.myMethod().url); // Doesn't work !
Logger.info(routes.MyController.myMethod().absoluteURL()); // Doesn't work !
Logger.info(routes.MyController.myMethod().absoluteURL(true)); // Doesn't work !
return ok();
}
}
Thanks for your help !