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> 
相關文章
相關標籤/搜索