java - 为什么即使我在 web.xml 中已经有安全约束,任何授权都不能访问我的服务?
问题描述
我在web.xml
. Role_TestWs
可以访问我的服务,但没有授权可以访问我的服务。我只想Role_TestWs
能够访问我的服务。
<security-constraint>
<web-resource-collection>
<web-resource-name>TestWs</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Role_TestWs</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>default</realm-name>
</login-config>
<security-role>
<role-name>Role_TestWs</role-name>
</security-role>
</web-app>
解决方案
推荐阅读
- flutter - 如何更改桌面 Windows 应用程序图标以进行颤振?
- c++ - 我正在尝试使用 -fsanitizer=address 进行编译,但不断收到“找不到 -lasan”
- java - Java 泛型参数是如何推断的?
- ios - UIImagePickerController 只能在主线程中使用 | 应用程序崩溃
- f# - 如何在 F# 中将 Excel 工作表放入 Deedle 数据框
- memory-management - Solaris 中的物理内存利用率
- python - 读取 5gb 以上的 csv 数据集
- gitlab - 阶段对于其他分支是可选的,但对于主分支是强制性的
- linux - __init 函数中的本地静态标识符会发生什么?
- repast-simphony - 批量运行后的模拟可视化