Request method ‘PUT‘ not supported
During ssm integration, the RESTful style was used for curd operations, but the following error occurred.
[org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PUT' not supported]
At first I thought that my request method was wrong, but after troubleshooting many times, I found that the problem was not here.
After searching the blog, I found the solution as follows. Similar Request method 'PUT'/ 'GET'/ 'POST'/ 'DELETE' not supported: can be solved by this method. The reason is that the backend @RequestMapping annotation is configured incorrectly.
-
Check the request URL of the front-end error report, and check the request method of the method. Pay attention to whether it carries the _method parameter. If it does, the real request method is the value corresponding to _method. For example: _method:put, although the displayed request method is post, the real request method is put
-
Check whether the value corresponding to the method annotated by @RequestMapping on the backend is consistent with the value attribute of the above method name, and whether it is consistent with the request URL of the frontend.