我在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>