How to get the current page URL in a view?

I want to use the URL of the current page on all my pages on my site to create a link.

I can do the following in my controller:

Http.Request.current().getBase() + Http.Request.current().url; 

But how can I do this? Is there a direct way?

+8
playframework
source share
1 answer

You can access Http.Request.current() in a view, just request .

So you need

 ${request.getBase()}${request.url} 
+15
source share

All Articles