title: How do I use html5 with jsf 2 and facelets?
body: <p>I'm trying to use the HTML5 doctype with jsf 2.1 and Facelets on a Glassfish 3.1.2 server.</p>
  
  <p>I've seen many places that we could just replace the xhtml doctype with html5 doctype</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
  </code></pre>
  
  <p>and leave the xmlns for xhtml in the -tag. in some forums they say that's it. But that's not it, at least Firefox doesn't agree as it render's the page as "HTML propritary" and not as HTML5.</p>
  
  <p>Seems like none of the tutorials considers the html page file extension? Is this something browsers care for? I've tried to change this from *.xhtml to *.html, removing the xhtml namespace from the -tag, and in web.xml change the </p>
  
  <pre><code> &lt;context-param&gt;
     &lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
     &lt;param-value&gt;.xhtml&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>To</p>
  
  <pre><code> &lt;context-param&gt;
     &lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
     &lt;param-value&gt;.html&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>And added servlet mapping for html. This did not work at all. </p>
  
  <p>Ok, I then reverted everything to default (xhtml/facelets), replaced only the doctype-tag and removed the xmlns referring to xhtml (from all files/templates). Now I get lot's and lot's of warnings such as these:</p>
  
  <pre><code> Warning: This page calls for XML namespace declared with prefix li but no taglibrary   exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix li but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix li but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix body but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix ul but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix form but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix a but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix a but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix a but no taglibrary exists for that namespace.
   Warning: This page calls for XML namespace declared with prefix a but no taglibrary exists for that namespace.
  </code></pre>
  
  <p>Ok, this did not look promising. In web.xml i changed the project stage from development to production.</p>
  
  <pre><code> &lt;context-param&gt;
       &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
       &lt;param-value&gt;Production&lt;/param-value&gt;
   &lt;/context-param&gt;
  </code></pre>
  
  <p>The warnings disappeared, and w3c's validator says this is valid html5.</p>
  
  <p>Does anybody have a better solution to this? Does jsf/facelets demand the files to have the extension xhtml?</p>