在application.yml中配置url访问路径和本地图片路径

 

Springboot读取本地图片并显示

 

方框1:url中访问路径,这里为:localhost:8080/testspringboot/image/...

方框2:本地图片保存的路径,image会根据E://picture和浏览器中输入的图片名字自动查找图片

打开浏览器,输入地址:localhost:8080/testspringboot/image/jinmao.jpg

Springboot读取本地图片并显示

 


目录下的图片可以正常显示!

相关文章:

  • 2020-05-01
  • 2021-12-22
  • 2021-09-21
  • 2021-11-28
  • 2021-12-09
  • 2021-10-06
  • 2021-09-30
  • 2021-12-19
猜你喜欢
  • 2021-09-21
  • 2021-09-30
  • 2021-12-01
  • 2021-11-04
  • 2021-09-30
  • 2021-11-01
  • 2021-09-21
  • 2021-09-21
相关资源
相似解决方案