我想,以防止從Tomcat的URL時在目錄結尾的目錄列表中的文件。這就像對的.htaccess Apache的。從一個目錄中列出文件防止Tomcat的/ Jboss的
這樣當用戶瀏覽到: www.test.com/f_apps/ - 沒有什麼是lised或錯誤信息 但要: www.test.com/f_apps/welcome.jsp - 正常工作
我認爲這是一個變化META-INF/context.xml的,但我還是新到Tomcat的東西,所以不知道如何修改它的這種變化。
我想,以防止從Tomcat的URL時在目錄結尾的目錄列表中的文件。這就像對的.htaccess Apache的。從一個目錄中列出文件防止Tomcat的/ Jboss的
這樣當用戶瀏覽到: www.test.com/f_apps/ - 沒有什麼是lised或錯誤信息 但要: www.test.com/f_apps/welcome.jsp - 正常工作
我認爲這是一個變化META-INF/context.xml的,但我還是新到Tomcat的東西,所以不知道如何修改它的這種變化。
您需要在/conf/web.xml
中禁用DefaultServlet
的listings
設置。
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
你可以找到它的文檔中的細節:http://tomcat.apache.org/tomcat-6.0-doc/default-servlet.html
見http://linux-sxs.org/internet_serving/c581.html,你可以更新web.xml做到這一點:
This is the first section in web.xml. The options that concern us are :
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
Change <param-value> to false and you turn off directory listing. It is that simple.