This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Disable dir listing in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Disable dir listing in tomcat" Watch "Disable dir listing in tomcat" New topic
Author

Disable dir listing in tomcat

Brian Daniel
Greenhorn

Joined: Oct 30, 2001
Posts: 11
If I point a browser at the root of my webapp
http://host/mywebapp/
I get a directory listing. Also works for all subdirs. How do I disable this?
Brian Daniel
Greenhorn

Joined: Oct 30, 2001
Posts: 11
N/m, finally found it myself. In tomcat 4.0+ in $CATALINA_HOME/conf/web.xml, change the listings parameter in the default servlet declaration to false.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Disable dir listing in tomcat