You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Garret Wilson <ga...@globalmentor.com> on 2005/01/12 03:28:29 UTC

Re: How to disable directory listing

You can't do it in your app's web.xml---unless you install another 
servlet (which can be the Tomcat default servlet) mapped to root in your 
own web.xml. But then you have to cart around all the Tomcat servlet 
jars in your webapp, because the one that is really the default was 
loaded by another classloader.

Garret

Phillip Qin wrote:
> Do it in your app's web.xml
> 
> -----Original Message-----
> From: Lee Chin Khiong [mailto:leeck@cmks.com.sg] 
> Sent: November 24, 2004 1:29 AM
> To: 'Tomcat Users List'
> Subject: RE: How to disable directory listing
> 
> 
> 
> Is there any better way to configure Tomcat 5 to no Directory listing just
> like IIS ?
> 
> -----Original Message-----
> From: Quinton Delpeche [mailto:quintond@vippayroll.co.za]
> Sent: Wednesday, November 24, 2004 2:19 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: How to disable directory listing
> 
> 
> On Wednesday 24 November 2004 08:09, Lee Chin Khiong wrote:
> 
>>How to disable directory listing under Tomcat 5 ?
> 
> 
> I use a blank index.html file and put it in all the directories that I don't
> 
> want to have listed. :)
> 
> Q

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


Re: How to disable directory listing

Posted by Dan Barron <db...@dswllc.com>.
Have a look at your <tomcat-root>/conf/web.xml file - you can turn off 
listings in here for all servlets by setting  the "listings" <initi-param> 
to "false" in the default servlet section.

Dan

At 06:28 PM 1/11/2005, Garret Wilson wrote:
>You can't do it in your app's web.xml---unless you install another servlet 
>(which can be the Tomcat default servlet) mapped to root in your own 
>web.xml. But then you have to cart around all the Tomcat servlet jars in 
>your webapp, because the one that is really the default was loaded by 
>another classloader.
>
>Garret
>
>Phillip Qin wrote:
>>Do it in your app's web.xml
>>-----Original Message-----
>>From: Lee Chin Khiong [mailto:leeck@cmks.com.sg] Sent: November 24, 2004 
>>1:29 AM
>>To: 'Tomcat Users List'
>>Subject: RE: How to disable directory listing
>>
>>Is there any better way to configure Tomcat 5 to no Directory listing just
>>like IIS ?
>>-----Original Message-----
>>From: Quinton Delpeche [mailto:quintond@vippayroll.co.za]
>>Sent: Wednesday, November 24, 2004 2:19 PM
>>To: tomcat-user@jakarta.apache.org
>>Subject: Re: How to disable directory listing
>>
>>On Wednesday 24 November 2004 08:09, Lee Chin Khiong wrote:
>>
>>>How to disable directory listing under Tomcat 5 ?
>>
>>I use a blank index.html file and put it in all the directories that I don't
>>want to have listed. :)
>>Q
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Re: How to disable directory listing

Posted by Ben Souther <bs...@fwdco.com>.
You don't need to install another servlet. servlet-api.jar is in the
common/lib directory (available to all webapps.)

I do it with an entry in my web.xml file that overrides the entry in the
global web.xml:

  <servlet>
    <servlet-name>hrpdefault</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>
                                                                                               The downside to this is that it makes your app less portable.








On Tue, 2005-01-11 at 21:28, Garret Wilson wrote:
> You can't do it in your app's web.xml---unless you install another 
> servlet (which can be the Tomcat default servlet) mapped to root in your 
> own web.xml. But then you have to cart around all the Tomcat servlet 
> jars in your webapp, because the one that is really the default was 
> loaded by another classloader.
> 
> Garret
> 
> Phillip Qin wrote:
> > Do it in your app's web.xml
> > 
> > -----Original Message-----
> > From: Lee Chin Khiong [mailto:leeck@cmks.com.sg] 
> > Sent: November 24, 2004 1:29 AM
> > To: 'Tomcat Users List'
> > Subject: RE: How to disable directory listing
> > 
> > 
> > 
> > Is there any better way to configure Tomcat 5 to no Directory listing just
> > like IIS ?
> > 
> > -----Original Message-----
> > From: Quinton Delpeche [mailto:quintond@vippayroll.co.za]
> > Sent: Wednesday, November 24, 2004 2:19 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: How to disable directory listing
> > 
> > 
> > On Wednesday 24 November 2004 08:09, Lee Chin Khiong wrote:
> > 
> >>How to disable directory listing under Tomcat 5 ?
> > 
> > 
> > I use a blank index.html file and put it in all the directories that I don't
> > 
> > want to have listed. :)
> > 
> > Q
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


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