01.<servlet>
02. <servlet-name>default</servlet-name>
03. <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
04. <init-param>
05. <param-name>debug</param-name>
06. <param-value>0</param-value>
07. </init-param>
08. <init-param>
09. <param-name>listings</param-name>
10. <param-value>false</param-value>
11. </init-param>
12. <load-on-startup>1</load-on-startup>
13. </servlet>
该段代码在tomcat的文档。在../conf/web.xml中有这样的配置:
将变量listings 的值改为true,就能在访问tomcat下的目录时能列出该目录下的所有文件和目录而不会再报404找不到路径的错误