Bloquear acesso a uma pasta

Pessoas, como eu defino diretivas de acesso a pastas e arquivos no Tomcat? No apache isso fica no arquivo .htaccess. Dá pra fazer isso no Tomcat?

Valeu, []'s.

Veja esse tutorial:

http://www.onjava.com/pub/a/onjava/2001/07/24/tomcat.html

E como faz para simplismente não indexar os diretórios?? (Quando acessar a pasta imagens/ exibir um erro de página não encontrada, invés de mostrar os arquivos da pasta)

No Apache isso é tão facinho, mas no tomcat… HEheHEH :smiley:

Também é facil:

In Tomcat 4.x, the Default Servlet serves static content. The Tomcat Functional Specifications require that implementations accept several parameters--including one that indicates whether to provide directory listings when a directory without welcome files is requested. 
To suppress directory listings in Tomcat 4, set the value of the servlet's initialization parameter listings to false in Tomcat's default deployment descriptor ($CATALINA_HOME/conf/web.xml). Below is Tomcat's default definition for the default servlet with directory listings disabled: 


    <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>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

Note, however, if you are using a separate web server (like Apache or IIS) with Tomcat, you will need to change the settings for the web server instead.