在网上找了只知道如何限制某个目录下的所有文件都不能访问
如下:限制了webapps/testFile目录下的所有文件都不能访问
问题1:
我想知道只限制testFile目录下的.txt类型的文件怎么做?
问题2:
或者我想只允许testFile目录下的png文件可以访问,要怎么做?
<security-constraint>
<display-name>Tomcat Server Configuration Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>testFile</web-resource-name>
<url-pattern>/testFile/*</url-pattern>
</web-resource-collection>
<auth-constraint>
</auth-constraint>
</security-constraint>