You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ivan Vasquez <iv...@itos.uga.edu> on 2004/09/03 00:29:09 UTC

How to prevent directory listing?

Is it possible to prevent a particular Struts webapp from displaying
directory listings? That is, global /conf/web.xml has its DefaultServlet
with listings set to true, thus enabling dir listing for all apps. Can I
then prevent a particular Struts webapp from doing so by setting
something in the local web.xml?

Thank you. 
Ivan.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to prevent directory listing?

Posted by Jason Lea <ja...@kumachan.net.nz>.
I think (haven't tried this myself) you can override it in your own 
application's web.xml

eg add this to your web.xml in the appropriate place

<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>

Ivan Vasquez wrote:

>Is it possible to prevent a particular Struts webapp from displaying
>directory listings? That is, global /conf/web.xml has its DefaultServlet
>with listings set to true, thus enabling dir listing for all apps. Can I
>then prevent a particular Struts webapp from doing so by setting
>something in the local web.xml?
>
>Thank you. 
>Ivan.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>


-- 
Jason Lea



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org