在Tomcat的conf目录下的Catalina的localhost里新建xml文件 在文件中编写: <Context docBase="D:\test" /> 即可 虚拟目录中访问使用xml文件的名字