关于jboss-tomcat限制目录访问的问题

05-01-11 changynfg

各位高手:我想限制一下jboss-tomcat web server的目录访问权限,如:http://url/admin/index.jsp作为访问url,但是,如果用户访问http://url/admin/就会将admin目录下面的文件都显示给用户,怎么控制一下不显示呢?

1
jishihuaidan
2015-02-10 10:25

Tomcat:

apache-tomcat-6.0.14\conf\web.xml

Jboss

jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar\conf\web.xml

jboss-4.2.2.GA\server\default\deploy\jboss-web.deployer\conf\web.xml

jboss-5.0.0.Beta4\server\default\deployers\jbossweb.deployer\conf\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>

把listings的值改成false

banq
2015-02-10 10:47

在/conf/web.xml加入:

<init-param>
    <param-name>listings</param-name>
    <param-value>false</param-value>
</init-param>
<p>

参考:http://tomcat.apache.org/tomcat-7.0-doc/default-servlet.html