我式了一下,整个项目完全正常,包括数据库联接也很正常,不过我发现在 Tomcat Web Application Manager 中我点击我的项目,往常如果我没有配置项目web.xml中的<welcome-file-list>,tomcat就会列出我的项目下面的文件和文件夹。比如我的项目叫wwwforum,那么现在的问题是我使用http://localhost:8080/wwwforum/XXXXXXX访问我的项目完全没问题,但是把目录切换到http://localhost:8080/wwwforum/时,往常应该 是显示wwwforum下面的文件和文件夹,但现在是: type Status report message /wwwforum/ description The requested resource (/wwwforum/) is not available. 不知为什么?请您指点,谢谢。
从tomcat.5.5.15开始,把目录浏览的默认值由允许改为了禁止目录浏览。37150: Turn off directory listing by default and add a warning regarding enabling listing of directories with many entries. (t) 打开conf/web.xml 第78行左右的内容: <init-param> <param-name>listings</param-name> <param-value>false</param-value> </init-param>详细内容参考tomcat的changelog和bug单: http://tomcat.apache.org/tomcat-5.5-doc/changelog.html http://issues.apache.org/bugzilla/show_bug.cgi?id=37150
没有的话,估计是你项目的配置问题吧,再检查一下
Tomcat Web Application Manager 中我点击我的项目,往常如果我没有配置项目web.xml中的<welcome-file-list>,tomcat就会列出我的项目下面的文件和文件夹。比如我的项目叫wwwforum,那么现在的问题是我使用http://localhost:8080/wwwforum/XXXXXXX访问我的项目完全没问题,但是把目录切换到http://localhost:8080/wwwforum/时,往常应该
是显示wwwforum下面的文件和文件夹,但现在是:
type Status report
message /wwwforum/
description The requested resource (/wwwforum/) is not available.
不知为什么?请您指点,谢谢。
第78行左右的内容:
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>详细内容参考tomcat的changelog和bug单:
http://tomcat.apache.org/tomcat-5.5-doc/changelog.html
http://issues.apache.org/bugzilla/show_bug.cgi?id=37150
<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>
如果listings为true就会显示文件列表,相反就不会显示