1

I have a rest application who use spring boot 1.4.2 with tomcat embedded

On client side, user can take picture via webcam and save it to the server.

In the server side, i save img in example : /home/test/img/

In my web application what i need to setup to be able to display image?

<img src="paul.jpg"/>

1 Answers1

1

You need to redefine the spring.resources.static-locations property, for instance:

spring.resources.static-locations=classpath:/static/,file:/home/test/img/
Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89
  • No, it won't. if they use other directories (such as ` public` they need to specify that as well). – Stephane Nicoll Nov 12 '16 at 14:13
  • seem like we can read: http://stackoverflow.com/questions/21123437/how-do-i-use-spring-boot-to-serve-static-content-located-in-dropbox-folder that do a replace... not a extend.. – robert trudel Nov 12 '16 at 14:48
  • Yes but if you know where your resources are it's really the same thing. It's a matter of taste, really. – Stephane Nicoll Nov 13 '16 at 12:08