Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

web.xml to disable directory browsing

843841Dec 21 2004 — edited Dec 24 2004
Hi all,

I'm wondering how I go about amending my web application's web.xml to disable directory browsing? I know that by amending the conf/web.xml you can disable directory browsing for all apps, but I wish to only set this property for a single web app. The following is part of the conf/web.xml that was amended to disable browsing (basically changing listings from true to false.
<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>
I've tried adding the above into my web-app's web.xml but receive configuration errors on deployment.

Any hints or tips would be much appreciated!

Regards

ribot
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 21 2005
Added on Dec 21 2004
6 comments
957 views