title: Changing JSF prefix to suffix mapping forces me to reapply the mapping on CSS background images
body: <p>I've been using prefix mapping for years and decided to switch to suffix
  mapping, just to get rid of the <code>/faces</code> in the url really. I just wanted
  to check I'm going in the right direction before I dig myself a hole as
  there are a few unexpected things going on. I changed from this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;FacesServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>to this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;FacesServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>And then I see that everything going through <code>FacesServlet</code> has <code>.xhtml</code>
  appended to it, so that the browser is requesting <code>background.png.xhtml</code> files,
  <code>style.css.xhtml</code> file - is this right? It is called suffix mapping I suppose,
  but it looks a bit untidy to me and I'm trying to convince myself it's
  the way to go.</p>
  
  <p>In my CSS files where an URI is referenced I also have to append <code>.xhtml</code>:</p>
  
  <pre><code>background-image: url(images/background.png.xhtml);
  </code></pre>
  
  <p>Then I saw a post from BalusC that gives a solution to prevent the
  download of resources without going via FacesServlet:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;security-constraint&gt;
      &lt;display-name&gt;Restrict raw XHTML docs&lt;/display-name&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;XHTML&lt;/web-resource-name&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint/&gt;
  &lt;/security-constraint&gt;
  </code></pre>
  
  <p>When I add this then only real <code>.xhtml</code> files load on the page, all
  other resources (despite having <code>.xhtml</code> appended) do not display.</p>
  
  <p>All I want to know is:</p>
  
  <ol>
  <li><p>Is this appending <code>.xhtml</code> to everything normal (sorry if the years
  silliest question)</p></li>
  <li><p>Why does the 'restrict raw xhtml docs' security constraint prevent resource such as
  CSS, JavaScript and images from loading?</p></li>
  </ol>
  
  <p>Thanks for any feedback. I am using Mojarra 2.1.2 on Glassfish 3.1.</p>