web工程禁用HTTP中PUT/ELETE等请求,防止恶意访问

在web.xml最后加入如下节点
<!--禁用PUT/DELETE请求 --> <security-constraint>   <web-resource-collection> <url-pattern>/*</url-pattern> <http-method>PUT</http-method> <http-method>DELETE</http-method>   </web-resource-collection>   <auth-constraint>   </auth-constraint> </security-constraint>

  

posted @ 2018-07-27 11:58  蓝色土耳其  阅读(825)  评论(0编辑  收藏  举报