Monday, August 13, 2007

Enabling directory listing in Tomcat

One and for all --- this is mainly for myself, because I tend to forget it and have to google it everytime I need it:

To enable/disable directory listings in Tomcat (5.x at least) I have to change the property listings of the default servlet in conf/web.xml

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

Tomcat FAQ - Miscellaneous Questions

No comments: