Reputation: 249
I want to use URL of current page in all my pages on my site for creating link button.
I can do the following in my controller:
Http.Request.current().getBase() + Http.Request.current().url;
But how can I do this in view? Is there direct way?
Upvotes: 8
Views: 8195
Reputation: 54924
You can access the Http.Request.current()
in the view, as simply request
.
So, you need
${request.getBase()}${request.url}
Upvotes: 15