• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing Files Outside of Tomcat

 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Bill

 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill,

Do you have an example or a link to an example of the servlet approach that you recommend? Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic