title: Servlet mapping jsf
body: <p>I'm asking myself which way is the best for servlet mapping in jsf? And Why? </p>
  
  <p>Especially I'm wondering always about the different suffix of the facelet resources and the suffix of the url-pattern of the servlet-mapping. My servlet mapping is always coherent to the suffix of my resources.  </p>
  
  <p>For Example if I'm using xhtml as facelets my servlet mapping does it also:</p>
  
  <pre><code>  &lt;servlet-mapping&gt;
       &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
       &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>But I see examples where the resources are xhtml files and the servlet mapping is on jsf?</p>
  
  <p>For Example:</p>
  
  <pre><code>  &lt;servlet-mapping&gt;
       &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
       &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>So which way is the best way? </p>
  
  <p>And also I'm wondering why the second way working at all?</p>