You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joseph Wong <jo...@hotmail.com> on 2000/11/26 16:30:53 UTC

How to disable directory listing in Tomcat?

I used Tomcat and Apache to run jsp where I mapped /jsp to Tomcat to handle 
jsp program, so I can call abc.jsp by http://ip-address/jsp/abc.jsp through 
browser.

However, when I call http://ip-address/jsp/ through browser, a list of jsp 
programs under /jsp dirctory were listed. How to disable this feature???

Joseph.
_____________________________________________________________________________________

Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


Re: How to disable directory listing in Tomcat?

Posted by "Julio Serje (@canada.com)" <js...@home.com>.
Hi, Joseph,

You can:

a) create an index.jsp page for your directory, or
b) create (or edit, if you have it already...) a web.xml file for your
webapp and alter the <welcome-file-list> section:


    <welcome-file-list>
       <welcome-file>
            index.jsp
        </welcome-file>
        <welcome-file>
            index.html
        </welcome-file>
        <welcome-file>
            index.htm
        </welcome-file>

         <!-- add this to enable abc as your welcome page -->
        <welcome-file>
            abc.jsp
        </welcome-file>

    </welcome-file-list>


Julio

----- Original Message -----
From: Joseph Wong <jo...@hotmail.com>
To: <to...@jakarta.apache.org>
Sent: Sunday, November 26, 2000 10:30 AM
Subject: How to disable directory listing in Tomcat?


> I used Tomcat and Apache to run jsp where I mapped /jsp to Tomcat to
handle
> jsp program, so I can call abc.jsp by http://ip-address/jsp/abc.jsp
through
> browser.
>
> However, when I call http://ip-address/jsp/ through browser, a list of jsp
> programs under /jsp dirctory were listed. How to disable this feature???
>
> Joseph.
>
____________________________________________________________________________
_________
>
> Get more from the Web.  FREE MSN Explorer download :
http://explorer.msn.com
>
>


RE: How to disable directory listing in Tomcat?

Posted by Saurabh Shukla <sa...@cysphere.com>.
1) Give a welcome file in your web.xml (if all your requests in /jsp goes to
tomcat.
2) Check the "options" in Directory directive(Apache documentation).

     Try something this in your httpd.conf(it might do the job for you)

	<DirectoryMatch /jsp>
	AllowOverride None
	Options None
	allow from all
	</DirectoryMatch>


-----Original Message-----
From: Joseph Wong [mailto:joe_clw@hotmail.com]
Sent: Sunday, November 26, 2000 9:01 PM
To: tomcat-user@jakarta.apache.org
Subject: How to disable directory listing in Tomcat?


I used Tomcat and Apache to run jsp where I mapped /jsp to Tomcat to handle
jsp program, so I can call abc.jsp by http://ip-address/jsp/abc.jsp through
browser.

However, when I call http://ip-address/jsp/ through browser, a list of jsp
programs under /jsp dirctory were listed. How to disable this feature???

Joseph.
____________________________________________________________________________
_________

Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com