3

Since storing uploaded files in the container of a Java EE web application is not recommended, I store them in a local directory outside the webroot.

Now I need to serve them to web users. With GlassFish, I know how to do so quite easily, using Alternate Document Roots. But I'm working with Tomcat right now, and I can't find a simple way. Is there a similar feature available on this server? Or do I really have to create a FileServlet to get the job done? If so, will I encounter performances issue when lots of users access those external files?

Edit: I read this answer saying that other servers seem to have similar systems, but I couldn't find anything.

Community
  • 1
  • 1
Med
  • 618
  • 9
  • 28

1 Answers1

1

With Tomcat 7, the aliases attribute might help.

Harald Wellmann
  • 11,788
  • 2
  • 36
  • 56