我会尝试以下方法:
<security-constraint> <web-resource-collection> <url-pattern>/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> </web-resource-collection> <!-- no auth-constraint tag here --></security-constraint><security-constraint> <web-resource-collection> <web-resource-name>restricted methods</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint/></security-constraint>
第一个
security-constraint没有任何
auth-constraint,因此GET和POST方法可用于任何无需登录的人。第二个限制了所有人的其他http方法。(我还没有尝试过。)



