Two Laptop Bag*
The moose likes Tomcat and the fly likes Turning off directory browsing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Turning off directory browsing" Watch "Turning off directory browsing" New topic
Author

Turning off directory browsing

Reuben Cleetus
Ranch Hand

Joined: Jul 13, 2001
Posts: 50
How does one turn off directory browsing on Tomcat 4.0.2?
Regards,
Reuben Cleetus
/*
Reuben Cleetus
web: http://rcleetus.dhs.org
*/
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Go into web.xml in the tomcat/conf directory.
<servlet>
<servlet-name>default</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>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Change:
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
to
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
Don't get me started about those stupid light bulbs.
 
subject: Turning off directory browsing