Getting full path URLs in views/templates
<link rel="stylesheet" href="@{'/public/stylesheets/main.css'}">
@{'/public/stylesheets/main.css'}
开发者_如何学Creturns the relative path: /public/stylesheets/main.css
How do I get the full path?
i.e. http://www.something.com/public/stylesheets/main.css
inside the view/template?
You have to use
@@{'/public/stylesheets/mains.CSS}
instead of using single @. See this PlayFramework Template Cheatsheet for example.
From PlayFramework Templates Documentation explains it as:
The @@{…} syntax does the same but generates an absolute URL (notably useful for e-mail).
精彩评论