1

I am running tomcat and I have some custom images which when I store on my C drive do not show up.If I move them to webapp root foder, they r fine but I do not want these images to end up in the war file.As I am using Windows symbolic link is not an option. Any idea as to how I can make the images show up without storing in the webapp root?

Paige Ruten
  • 172,675
  • 36
  • 177
  • 197

2 Answers2

1

The web server will need the images to be stored in a web folder (root or virtual directory) to interperet the URL to a local file location.

If on the other hand you are referencing your images using file:// then the web server is not serving the files, the OS is, and will only work for local users that have access to the files.

Ady
  • 4,736
  • 2
  • 22
  • 20
0

Well, you can also manage them by your app - that is when you get the request for the image, your application reads it from the disk, sets proper Content-type and outputs the image.

That is not recommended tho. Better leave this job to the web server.

kender
  • 85,663
  • 26
  • 103
  • 145