title: How to configure web.xml, glassfish-web.xml files for JSF?
body: <p>I have simple project with no servlet but with a JavaBean class used in JavaServer Faces xhtml files. </p>
  
  <p><a href="https://i.stack.imgur.com/126Q4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/126Q4.png" alt="enter image description here"></a></p>
  
  <p>How do i configure web.xml, glassfish-web.xml files? The whole project is managed by maven.</p>
  
  <p>Here is the content of web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
      version="4.0"&gt;
  
      &lt;display-name&gt;LoginJSFApp&lt;/display-name&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.xhtml&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and glassfish-web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"&gt;
  &lt;glassfish-web-app&gt;
      &lt;context-root&gt;/LoginJSFApp&lt;/context-root&gt;
  &lt;/glassfish-web-app&gt;
  </code></pre>