1

I am using Spring MVC and Tomcat 8.0.36 for my web application. I have an image directory to access, but it is outside the website directory. Here is what I have, but it seems not working:

<mvc:resources mapping="/uploads/v1/**" location="Z:/uploads/v1/" /> 

The website is located at:

E:\website\tomcat\webapps\mysite

Does Spring support such access? The site runs on Windows. I am hoping that

http://mysite/uploads/v1/image.jpg would be served from Z:/uploads/v1/

halfer
  • 19,824
  • 17
  • 99
  • 186
curious1
  • 14,155
  • 37
  • 130
  • 231

1 Answers1

0

I read some posts at SO about similar questions, such as this one:

Configure Symlinks for single directory in Tomcat

The interesting thing is that I did not use context or something. I simply created a symbolic link under /site/uploads by using this command:

mklink /D v1 Z:\uploads\v1

I also used the following in spring:

<mvc:resources mapping="/uploads/v1/**" location="/uploads/v1/" />
curious1
  • 14,155
  • 37
  • 130
  • 231