title: How to expose JSF (.xhtml) under a sub folder of WebContent
body: <p>I'm currently having trouble exposing my JSF files from the browser URL. My project structure goes something like this:</p>
  
  <pre><code>&lt;PROJECT_NAME&gt;
  ---&gt;WebContent
      ---&gt;index.xhtml
      ---&gt;subfolder1
          ---&gt;subjsf.xhtml
      ---&gt;subfolder2
          ---&gt;subjsf.xhtml
      ---&gt;subfolder3
          ---&gt;subjsf.xhtml
  </code></pre>
  
  <p>Here's my web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
   &lt;display-name&gt;PROJECT_NAME&lt;/display-name&gt;
   &lt;context-param&gt;
    &lt;param-name&gt;org.richfaces.skin&lt;/param-name&gt;
    &lt;param-value&gt;blueSky&lt;/param-value&gt;
   &lt;/context-param&gt;
   &lt;servlet&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
   &lt;/servlet&gt;
  
   &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;
  
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/pages/*&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
  
   &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.xhtml&lt;/welcome-file&gt;
   &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My faces-config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xi="http://www.w3.org/2001/XInclude"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"&gt;
   &lt;navigation-rule&gt;
    &lt;from-view-id&gt;/index.xhtml&lt;/from-view-id&gt;
    &lt;navigation-case&gt;
     &lt;from-outcome&gt;subfolder1&lt;/from-outcome&gt;
     &lt;to-view-id&gt;/subfolder1/subjsf.xhtml&lt;/to-view-id&gt;
     &lt;redirect/&gt;
    &lt;/navigation-case&gt;
   &lt;/navigation-rule&gt;
   &lt;application&gt;
    &lt;resource-bundle&gt;
     &lt;base-name&gt;resources&lt;/base-name&gt;
     &lt;var&gt;msgs&lt;/var&gt;
    &lt;/resource-bundle&gt;
   &lt;/application&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>Without using a redirect, it seems to work fine. But enabling redirect gives this error:</p>
  
  <pre><code>com.sun.faces.context.FacesFileNotFoundException: /subjsf.xhtml Not Found in ExternalContext as a Resource
  </code></pre>
  
  <p>When you access the URL directly something like this: <code>&lt;hostname&gt;:&lt;port&gt;/PROJECT_NAME/subfolder1/subjsf.xhtml it also gave the same error above.</code></p>
  
  <p>I want to enable the redirect for the URL to refresh and display the current page name. Also, is there a way to use implicit navigation with sub folders?</p>
  
  <p>Really appreciated your help guys! Thank you in advance...</p>