How to generate full URL ?

Normal URL generation, with simple @controllers.routes.UserController.login, generates only relative URI (such as /login.html). To generate full URL, with host and protocol, we could use absoluteURL() function:

@controllers.routes.UserController.login.absoluteURL(request())

Previous code will generate an URL begining with http://. To generate absolute URI for https, we could specify supplementary flag to absoluteURL method:

@controllers.routes.UserController.login.absoluteURL(request(), true)