6

Any ideas how to get the current URL with the play framework? I'm also looking for the full target URL. I know I can use @{Controller.method} but I need the full url (for the Facebook like button)

2 Answers2

10

An absolute path is created using @@

So, you would use

@@{Controller.method}

However, to get the current path, without specifying a specific controller and action, you can use

${request.url}
Codemwnci
  • 54,176
  • 10
  • 96
  • 129
7

In Play 2.0, it's

@request.path

(more info here)

Drew Johnson
  • 18,973
  • 9
  • 32
  • 35