tomcat虚拟路径

目的:减小项目大小,方便部署和资源共享

tomcat/conf/server.xml

host 标签中添加

      <Context docBase="/Users/huhuixin/Downloads/TomcatDownload/imsTest" path="/download" reloadable="true" debug="0"/>

 

即可通过  ip:port/download/...   访问到/Users/huhuixin/Downloads/TomcatDownload/imsTest下的静态资源文件.

原文地址:https://www.cnblogs.com/huhuixin/p/6200675.html