I would like to be able to store files that will be linked off a web page outside of the web application itself. This would allow me to redeploy without having to backup all the files first. How do I do that?
Since servlet containers are not allowed to directly serve resources stored outside the application directory structure you will have to be indirect. Make your link point to a servlet that can use the file system to read and send the files.
Note that you will have to pay attention to setting the headers for content type and length.
Joined: Jul 03, 2008
Do you have an example or a link to an example of the servlet approach that you recommend? Thanks.