转自 : https://blog.csdn.net/cheney550995353/article/details/70185282

1.使用tomcat自己的虚拟路径

1.1.在tomcat\config\server.xml中配置

path="/upload" 虚拟路径

E:\photo\upload 图片存放的真实路径

 <Context  path="/upload"  docBase="E:\photo\upload" reloadable="true"/></Host>

idea设置tomcat虚拟路径的两种方法

1.2.将Deploy applications configured in Tomcat instance勾上

idea设置tomcat虚拟路径的两种方法

2.用idea设置虚拟路径

2.1.Deploy applications configured in Tomcat instance不要勾上

idea设置tomcat虚拟路径的两种方法

2.2.设置虚拟路径

idea设置tomcat虚拟路径的两种方法

idea设置tomcat虚拟路径的两种方法

idea设置tomcat虚拟路径的两种方法

设置成功后,此文件夹的资源就可以像webapps/ROOT文件夹下访问一样了

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2021-07-22
  • 2021-09-22
  • 2021-11-30
  • 2021-04-20
  • 2021-07-17
猜你喜欢
  • 2021-07-31
  • 2021-07-15
  • 2021-12-10
相关资源
相似解决方案