1: tomcat\conf\Catalina\localhost下新建xml文件
添加:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/etao" docBase="D:/etao" reloadbale="true"/>
2:如果想直接访问xml或者文件夹,就必须将
web.xml中的
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<param-name>listings</param-name>
<param-value>true</param-value>
listings参数设置为true