File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Disable Directory Listing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Disable Directory Listing" Watch "Disable Directory Listing" New topic

Disable Directory Listing

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 642
I have and application in jakarta-tomat..\webapps
say myapps
it have dir's called jsp,html img.
i have to disable the directory listing,i.e if I try to access url
entire directory structure is displayed on browser
can any one help me how can i hide this
thanx a bunch

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63874

I seem to recall this being asked (and answered) somewhere in the Tomcat forum in the not too distant past.
You might to search through that forum for your answer.

[Asking smart questions] [About Bear] [Books by Bear]
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 642
thanx a bunch Bear
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
Just set the <welcome-file> node to point to a default or entry page for your application.

Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 642
thank U Philip Shanks
Ken Januski
Ranch Hand

Joined: Aug 08, 2002
Posts: 130
Also see the following, which suggests setting listings to false in server.xml. That's what I've always done.
I agree. Here's the link:
subject: Disable Directory Listing
It's not a secret anymore!