How to enable directory listing in EAP 7

Solution Verified - Updated -

Issue

  • How do I enable directory listing in EAP 7?
  • I would like to enable directory listing for the application which is deployed in EAP 7. I was able to do this with EAP 6.4 using the following CLI. What is the equivalent configuration in EAP 7?

    /subsystem=web/configuration=static-resources/:write-attribute(name=listings,value=true)
    
  • I enabled the following custom file handler in undertow subsystem to serve static contents from the specific path in EAP 7, but the directory listing feature is not enabled for this. How do I enable the directory listing feature for this file handler?

    <subsystem xmlns="urn:jboss:domain:undertow:4.0">
        ...
        <server name="default-server">
            <http-listener name="default" socket-binding="http" ... />
            ...
            <host name="default-host" alias="localhost">
                <location name="/" handler="welcome-content" />
                <location name="/example" handler="example-file-handler" /> <!- added this -->
            </host>
        </server>
        ...
        <handlers>
            <file name="welcome-content" path="${jboss.home.dir}/welcome-content" />
            <file name="example-file-handler" path="/path/to/example/static-contents" /> <!- added this -->
        </handlers>
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In