1. 程式人生 > >解決springMvc不能接收put,delete請求問題

解決springMvc不能接收put,delete請求問題



嗯  在springmvc配置如下

<filter>

         <filter-name>HttpMethodFilter</filter-name>

         <filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class>

</filter>

<filter-mapping>

         <filter-name>HttpMethodFilter</filter-name>

         <url-pattern>/*</url-pattern>

</filter-mapping>

        

<filter>

         <filter-name>HiddenHttpMethodFilter</filter-name>

         <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>

</filter>

<filter-mapping>

         <filter-name>HiddenHttpMethodFilter</filter-name>

         <url-pattern>/*</url-pattern>

</filter-mapping>

然後就可以了