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

 

Springboot读取本地图片并显示

 

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

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

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

Springboot读取本地图片并显示

 


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

相关文章:

  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-12-30
  • 2021-07-31
  • 2021-08-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2021-10-28
  • 2021-11-15
相关资源
相似解决方案