Tomcat5.5 虚拟目录 看不见 Directory Listing FOR

来源:百度知道 编辑:UC知道 时间:2024/05/22 15:57:09
我的虚拟目录是按照下面设置的
加在</Host>前面
<Context path="/web" debug="0" docBase="e:/web" reloadable="true"> </Context>
web.xml 是放在E:\web\WEB-INF里面的
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

打开conf\web.xml文件.
修改<servlet>
<servlet-name>default<rvlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet<rvlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</srvlet>

listings的值
true 默认值,显示目录下的文件并列表
false 不显示目录下的文件