File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes How to avoid directory listing? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "How to avoid directory listing?" Watch "How to avoid directory listing?" New topic
Author

How to avoid directory listing?

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 263
If the users types in an url for a directory ( like http://www.myDomain.com/myApp/dir/ ) tomcat displays the directory listing.

How can I deny permission for the users to see the directory listing. Is it possible to control it in the server.xml?
Gerardo Tasistro
Ranch Hand

Joined: Feb 08, 2005
Posts: 362
It is done in the web.xml. Go to conf/web.xml in your tomcat install. Looke for the following code and replace true for false



As shown below

Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
You need to change the Default servlet listing parameter in $CATALINA_HOME/conf/web.xml

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 263
Thank you. That works :-)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to avoid directory listing?
 
Similar Threads
redirect to /folder with domain name.
Web Application Manager authorization problem
Absolute path for jsp
mapping default page to domain name in tomcat without port number.in Ubuntu
Turn off directory listings