title: JSF 2:How include style sheets and javascript?
body: <p>i'm having a strange problem,
  if my page index.xhml is:</p>
  
  <pre><code>&lt;html   xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
  
      &lt;head&gt;
      //.. import css and javascript
      &lt;/head&gt;
      &lt;body&gt;
      // .. my page content
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Everthing is okay, but, if i change to <code>&lt;head&gt;</code> to <code>&lt;h:head&gt;</code> and <code>&lt;body&gt;</code> to <code>&lt;/h:body&gt;</code> my page it seems not apply the style very well, as far i can tell it seems my javascript file is not been applied in the page.
  Why this happen ? I already try change to <code>&lt;h:outputScript library="javascript" name="file.js" /&gt;</code> but it doesn't work either.</p>
  
  <p>Any idea ? Why this is happening ?</p>