4 Replies Latest reply on May 10, 2004 10:11 AM by aanand

    stop directory listing

    aanand Newbie

      Hi,
      Iam using jboss 3.2.3/Apache Tomcat/4.0.6
      How do I disable directory listing for example when I enter this URL I can all contents under the directory ..

      http://localhost:8888/test

      Where is the tomcat conf file. I know this is doable in Apache but how to do this in Jboss/Tomcat environment.

      Thanks.
      --Anand

        • 1. Re: stop directory listing
          James Ward Newbie

          Check out the web.xml file in your deploy/jbossweb-tomcat41.sar dir (Or similar depending on your version of JBoss). Look for "listings". I think this is documented pretty well in that file.

          I hope that helps.

          -James

          • 2. Re: stop directory listing
            aanand Newbie

            Thanks James.
            I did find 'listings' in the web.xml changed the value to false. Somehow still I can see the directory listing.
            Is there anything else do I need to change ?
            FYI .. I am using Jboss-3.2.3 on WinXP.
            Thanks.
            --Anand

            • 3. Re: stop directory listing
              James Ward Newbie

              I just tested this on jboss-3.2.3 on Linux. It appears to work correctly, but only after a JBoss restart. Here is a snippet from my jbossweb-tomcat41.sar/web.xml file:

               <servlet>
               <servlet-name>default</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>false</param-value>
               </init-param>
               <load-on-startup>1</load-on-startup>
               </servlet>
              


              • 4. Re: stop directory listing
                aanand Newbie

                Thanks. It works on Linux but not on WinXP, I have to figure out how to stop on XP though.

                --Anand