ApacheTomcat拒绝对文件的访问

ApacheTomcat拒绝对文件的访问,tomcat,configuration,url-rewriting,Tomcat,Configuration,Url Rewriting,我想拒绝访问Apache Tomcat服务器上的某些文件。 我阅读了文档/articles/e.t.c.,所有这些都是关于编写web.xml的,但我这样做了,在tomcat_home/conf目录下,重新启动tomcat服务器,什么也没发生。请帮帮我 我已添加内部web应用程序标记: <security-constraint> <web-resource-collection> <url-pattern>/sample</url-p

我想拒绝访问Apache Tomcat服务器上的某些文件。 我阅读了文档/articles/e.t.c.,所有这些都是关于编写web.xml的,但我这样做了,在tomcat_home/conf目录下,重新启动tomcat服务器,什么也没发生。请帮帮我

我已添加内部web应用程序标记:

     <security-constraint>
  <web-resource-collection>
    <url-pattern>/sample</url-pattern>
    <http-method>GET</http-method>
  </web-resource-collection>
 <auth-constraint>
<role-name>managers</role-name>

</auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Test Realm</realm-name>
    </login-config>

/样品
得到
管理者
基本的
测试领域