title: How to set JSF2 <welcome-file> with faces servlet mapping?
body: <p>I have a simple JSF2 app using Facelets. My web.xml is set as follows:-</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>I want to set the app to default to the welcome page which is /pages/login.xhtml. I can't seem to get the welcome-file setting to pick up this when going to the context root in the browser.</p>
  
  <p>My web.xml welcome setting is as follows:-</p>
  
  <pre><code>&lt;welcome-file-list&gt;
  &lt;welcome-file&gt;/pages/login.jsf&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  </code></pre>
  
  <p>How do I force the welcome-page to goto the login page and ensure it goes through the faces servlet?</p>
  
  <p>If I use the following the page displays but it hasn't gone through the faces servlet and so faces components aren't rendered:-</p>
  
  <pre><code>&lt;welcome-file-list&gt;
  &lt;welcome-file&gt;pages/login.xhtml&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  </code></pre>
  
  <p>Any help appreciated!</p>