I have a web application deployed to Tomcat 6 as a WAR file. From within the application I would like to serve files in a directory from within that context. For example, I deploy myapp.war
to /mydir/webapps
and I access my application via:
http://myhost:myport/myapp/
I would like to serve files via:
http://myhost:myport/myapp/files/somefile.txt
How can I do this? So far, I am only able to serve files outside of the application context:
http://myhost:myport/files/somefile.txt
with the files sitting in /mydir/webapps/files
instead of in the /mydir/webapps/myapp/files
directory.