1 Reply Latest reply on Aug 28, 2014 5:38 AM by jaysensharma

    Directory listing not working in JBOSS

    ankur328

      Hi

       

      I have a server.log file in JBOSS. Is there any way i can see the file on browser or download the same from browser only. So i thought of listing the JBOSS files on browser by the below approach:

       

      I have tried to list the files on JBOSS by adding the below code in both JBoss conf/web.xml and applications WEB-INF/web.xml but isnt displaying anything :

       

      hostname:10180/abc (abc is the url pattern)

       

       

      <servlet> <servlet-name>DirectoryListingOD</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>true</param-value> </init-param>


      </servlet> <servlet-mapping> <servlet-name>DirectoryListingOD</servlet-name> <url-pattern>abc</url-pattern> </servlet-mapping>


      Can someone please help on this?




        • 1. Re: Directory listing not working in JBOSS
          jaysensharma

          Directory listing can be enabled globally as following configuration [static-resources listings="true"]:

           

          <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">
                      <configuration>
                          <static-resources listings="true"/>
                      </configuration>
                      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
                      <virtual-server name="default-host" enable-welcome-root="true">
                          <alias name="localhost"/>
                          <alias name="example.com"/>
                      </virtual-server>
          </subsystem>
          

          You can also use the following CLII command to generate the same configuration:

           

          /subsystem=web/configuration=static-resources/:write-attribute(name=listings,value=true)