How to enable directory listing for Tomcat

Created:

2016-11-16 12:42:01 UTC

Modified:

2017-08-08 13:13:29 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to enable directory listing for Tomcat

Applicable to:

  • Plesk 12.5 for Windows

Question

How can I enable the directory indexing so the complete war file content will show in root directory?

Resolution

The DefaultServlet of Tomcat is by default configured to not show directory listings. You need to open Tomcat's own /conf/web.xml file (look in Tomcat installation folder), search the <servlet> entry of the DefaultServlet and then change its listings initialization parameter

from

<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>

to

<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>

Note: These changes will affects all folders of your web application.

If directory listing requires for some particular folder, you should write some Servlet code by yourself

Have more questions? Submit a request
Please sign in to leave a comment.