Alberto
Alberto

Reputation: 2982

Tomcat enable listing only in a folder

How can I enable the direcotry listing only in a particular folder inside Apache Tomcat 7? I alredy tried to add this

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

in the global web.xml but it enables the listing of all folder

Upvotes: 1

Views: 2110

Answers (1)

Mark Thomas
Mark Thomas

Reputation: 16635

The only way you can do this with configuration is to enable listing for all folders within a web application and then ensure a welcome file is present for all folders you don't want listings for.

The other (non-configuration) approach would be to extend Tomcat's default Servlet, add whatever listing logic you require and then configure your custom version as the default servlet for your application.

Upvotes: 1

Related Questions