Skip to content

cannot access files in appbase’s subfolder in tomcat

I have a very simple Tomcat web app.

This app is deployed to ${catalina.home}/webapps/myapp. Under myapp there are two folders:
1. WEB-INF – contains a single web.xml file with bare minimal content.
2. document – contains a folder called data.

My goal is to access any files under document folder.

Now I can access files under document folder without problem. i.e. open http://hostname:8080/myapp/document/abc.txt in browser will show the text file content.

But I can’t access files under document/data, i.e, open http://hostname:8080/myapp/document/data/xyz.txt in browser will get 404 error.

Is there any configuration that I missed? Thanks a lot!



This is resolved. I believe the problem was the web.xml. What I did was copying the sample web.xml from tomcat/webapps/docs/WEB-INF.