I have got a folder with many excel documents in it on tomcat and i want those files to be available when i got go the that folder’s url in the browser (eg http;//localhost:8080/myfolder)
at the moment when i try to access a folder i get a 404 error. by if i try to access a file that is in that folder, it works.
The
DefaultServletof Tomcat is by default configured to not show directory listings. You need to open Tomcat’s own/conf/web.xmlfile (look in Tomcat installation folder), search the<servlet>entry of theDefaultServletand then change itslistingsinitialization parameter fromto
Keep in mind that this affects all folders of your webapp. If you want to enable this for only an individual folder, you’ve got to write some
Servletcode yourself which does the job with help of thejava.io.FileAPI in servlet side to collect the files and some bunch of HTML/CSS in JSP side to present it in a neat fashion.