title: Enabling JBoss AS 7 Directory Listings
body: <p>I have the following directory structure deployed to JBoss AS 7.1.1.Final (under <code>standalone/deployments</code>):</p>
  
  <pre><code>doc.war
      -&gt; module1
          -&gt; index.html
      -&gt; module2
          -&gt; index.html
  </code></pre>
  
  <p>As you can see, there's no index.html under doc.war. When I browse to <strong>localhost:8080/doc/module1/</strong>, the correct index.html is displayed, but when I browse to <strong>localhost:8080/doc/</strong>, JBoss shows an error message (<em>404 - The requested resource is not available</em>).</p>
  
  <p>I think this is related to the fact that directory listings are turned off by default in JBoss AS 7. How can I enable directory listings, either globally or more specifically for this one application?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Based on Mukul Goel's answer, I ran the CLI command to add the <em>static-resources</em> feature, restarted the server and retried the request, but it didn't work.</p>
  
  <p>Here's the relevant snippet from the <code>standalone.xml</code> file. Please note that I have the <em>native</em> connector enabled.</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="true"&gt;
      &lt;configuration&gt;
          &lt;static-resources listings="true"/&gt;
      &lt;/configuration&gt;
      &lt;connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/&gt;
      &lt;connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https"/&gt;
      &lt;virtual-server name="default-host" enable-welcome-root="true"&gt;
          &lt;alias name="localhost"/&gt;
          &lt;alias name="example.com"/&gt;
      &lt;/virtual-server&gt;
  &lt;/subsystem&gt;
  </code></pre>
  
  <p>Here's the error message that JBoss is showing:</p>
  
  <p><img src="https://i.stack.imgur.com/sGoWR.png" alt="JBoss Error Message"></p>
  
  <p><strong>Update</strong></p>
  
  <p>So the conclusion to this seems to be that there is an issue with the official JBoss 7.1.1.Final (<a href="http://www.jboss.org/jbossas/downloads" rel="nofollow noreferrer">http://www.jboss.org/jbossas/downloads</a>) download. I didn't manage to get Directory Listings working with this version. Trying a later version (from the JBoss CI server at <a href="https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/" rel="nofollow noreferrer">https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/</a>), I was able to see the directory listings after applying the config change that Mukul Goel had suggested below.</p>
  
  <p>A potential source of this issue could be the version of JBossWeb that is used in JBoss. The official 7.1.1.Final bundles JBossWeb 7.0.13. Mukul (see below) was able to get it working running a version of JBoss that bundles JBossWeb 7.0.16.</p>
  
  <p>I'm accepting Mukul Goel's answer as solving this issue, but be aware that it will probably not work with the official 7.1.1.Final download.</p>