需求:

前端上传图片,返回路径给前端,前端通过路径来访问图片的资源。

解决方案:

<mvc:resources mapping="/${mapping_path}/**" location="file:${local_path}/"></mvc:resources>

对应的propterties文件的配置:

mapping_path = resouce
local_path = /root/home/img/

总结:

当时对其中的注解一知半解,导致遇到了这个问题。自己还应该加深基础。多多去找为什么会是这样。多多探索配置背后的问题。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-03-30
  • 2021-12-06
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-26
  • 2022-01-06
  • 2021-10-09
  • 2022-12-23
  • 2021-11-03
相关资源
相似解决方案