title: 404 Error pages not being displayed when accessing non-existent JSF pages in WildFly
body: <p>I'm deploying my app to WildFly 8 and have attempted to configure it so that a custom 404 error page is given by adding the following into my web.xml</p>
  
  <pre><code>&lt;error-page&gt;  
      &lt;error-code&gt;404&lt;/error-code&gt;  
      &lt;location&gt;/error.jsf&lt;/location&gt;  
  &lt;/error-page&gt;
  </code></pre>
  
  <p>This works fine when I try to access non-JSF pages that don't exit.  For example if I attempt to access a page called IDoNotExist.html, then my error page is displayed correctly.</p>
  
  <p>If however, I attempt to access a JSF page that doesn't exist, e.g. IDoNotExist.jsf, then I don't get my custom error page - I just get a blank page and the following error is logged to WildFly.</p>
  
  <pre><code>WARNING [javax.enterprise.resource.webcontainer.jsf.context] (default task-8) JSF1091: No mime type could be found for file  
  /IDoNotExist.jsp.  To resolve this, add a mime-type mapping to the applications web.xml.  
  </code></pre>
  
  <p>Note that the error log references a .JSP page whereas I attempted to acces a .JSF page.</p>
  
  <p>I've tried adding a mime type mapping for JSP pages, and although that gets rid of the error message on the console, I still don't see my custom 404 page for non-existant JSF pages.</p>
  
  <p>I've also thought that some exception is maybe being thrown before the page is rendered so I've tried adding an exception error handler in web.xml, but this has made no difference either.</p>
  
  <p>Is there something missing from my web.xml file or is some other configuration required?</p>
  
  <p>My web.xml is simply:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
           version="3.1"&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;404&lt;/error-code&gt;
          &lt;location&gt;/error.jsf&lt;/location&gt;
      &lt;/error-page&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Thanks.</p>