title: How to reference CSS / JS / image resource in Facelets template?
body: <p>I've done <a href="http://docs.oracle.com/javaee/6/tutorial/doc/giqxp.html" rel="noreferrer">tutorial about Facelets templating</a>. </p>
  
  <p>Now I've tried to create a page that isn't in same directory as the template. I've got problems with page style, because of styles are referenced with relative path like so:</p>
  
  <pre><code>&lt;link rel="stylesheet" href="style_resource_path.css" /&gt;
  </code></pre>
  
  <p>I can use absolute referencing by starting with <code>/</code>:</p>
  
  <pre><code>&lt;link rel="stylesheet" href="/project_root_path/style_resource_path.css" /&gt;
  </code></pre>
  
  <p>But this will bring me troubles when I'll be moving application to a different context.</p>
  
  <p>So I'm wondering what is best way to reference CSS (and JS and image) resources in Facelets?</p>