1. Configure in the Web. xml file
1<!--the Hiddenhttpmethodfilter filter can convert post requests into put requests and delete requests! -2<Filter>3<Filter-name>Hiddenhttpmethodfilter</Filter-name>4<Filter-class>Org.springframework.web.filter.HiddenHttpMethodFilter</Filter-class>5</Filter>6<filter-mapping>7<Filter-name>Hiddenhttpmethodfilter</Filter-name>8<Url-pattern>/*</Url-pattern>9</filter-mapping>
2. In form fields
You need to bring a parameter with a name value of _method,value value of put or delete, as follows:
1 <formAction= "${pagecontext.request.contextpath}/order/1"Method= "POST">2<inputtype= "hidden"name= "_method"value= "Put"/>3<inputtype= "Submit"value= "Submit"/>4</form>5<formAction= "${pagecontext.request.contextpath}/order/1"Method= "POST">6 <inputtype= "hidden"name= "_method"value= "Delete"/>7<inputtype= "Submit"value= "Submit"/>8</form>
Springmvc a POST request into a put or delete request in a form