I figured it out myself. Luckily I had done it before with Tomcat and the struggle finally came back to me.
In the conf/web.xml file you set listings to false. For example
That will disable directory browsing. I found the answer on the Java Sun forum as well, here is a link: