1.在conf/server.xml的标签中添加

<Context docBase="G:\Temp" path="/img" reloadable="true" crossContext="true" />

然后在浏览器中就可以通过localhost:8080/img/001.png访问到图片了。

2.在IDEA中配置
tomcat配置图片服务


tomcat配置图片服务


tomcat配置图片服务


然后就可以通过localhost:8080:/ceshi/001.png访问到图片了。

相关文章:

  • 2022-01-18
  • 2022-12-23
  • 2021-04-27
  • 2021-09-27
  • 2021-05-26
  • 2022-01-03
  • 2021-06-04
  • 2021-05-21
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2021-11-22
  • 2021-12-12
  • 2021-09-02
  • 2022-12-23
相关资源
相似解决方案