I would like to prevent Tomcat from listing the files in a directory when the URL ends at directory. This would be like .htaccess for apache.
So that when a user navigates to :
http://www.test.com/f_apps/ — nothing is lised or error message
but going to:
http://www.test.com/f_apps/welcome.jsp — works correctly
I assume it’s a change to META-INF/context.xml but I’m still new to Tomcat stuff so wasn’t sure how to modify it for this change.
You need to disable the
DefaultServlet‘slistingssetting in/conf/web.xml.You can find details in its documentation: http://tomcat.apache.org/tomcat-6.0-doc/default-servlet.html