我正在使用Tomcat作为我的Struts2应用程序.在web.xml如下所示具有一定的条目:
<security-constraint>
<web-resource-collection>
<web-resource-name>restricted methods</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>TRACE</http-method>
</web-resource-collection>
<auth-constraint />
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>no_access</web-resource-name>
<url-pattern>/jsp/*</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>no_access</web-resource-name>
<url-pattern>/myrrunner/*</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)
如何更改上面列入黑名单的部分只使用白名单部分...例如,我需要将其他方法列入白名单,而不是黑名单PUT,DELTE但我不确定将它们列入白名单的语法以及将它们列入白名单的方法.
对于我上面的web.xml片段,我会很感激,如果有人可以为我提供whitelisitng对应部分xml.
编辑:另外,我如何真正验证解决方案是否有效?
谢谢