Web 中的安全约束.xml未应用于具有文件扩展名的 URL 模式
2022-09-04 03:51:29
我在 Web 中输入了以下安全约束.xml。我的目标是 XML 文件位于公共区域。这适用于文件夹。但是,url模式似乎不起作用。有什么想法吗?/images/*
*.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Public Area</web-resource-name>
<url-pattern>/xyz</url-pattern>
<url-pattern>/images/*</url-pattern>
<url-pattern>/yyz/*</url-pattern>
<url-pattern>*.xml</url-pattern>
</web-resource-collection>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Super User Area</web-resource-name>
<url-pattern>/test/list1</url-pattern>
<url-pattern>/test/list2</url-pattern>
<url-pattern>/test/list3</url-pattern>
<url-pattern>/test/admin.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>SUPER_USER</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
<role-name>END_USER</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<description>Super User</description>
<role-name>SUPER_USER</role-name>
</security-role>
<security-role>
<description>Admin User</description>
<role-name>ADMIN</role-name>
</security-role>
<security-role>
<description>End User</description>
<role-name>END_USER</role-name>
</security-role>