restful与springboot结合的坑

mac2022-07-01  16

通过springboot用restful风格进行crud操作时,进行Put映射时,特别注意表单是不能够进行put请求的,所以要用下面的表达方式来进行

<form th:action="@{/emp}" method="post"> <input type="hidden" name="_method" value="put" th:if="${emp!=null}"/> <input type="hidden" name="id" th:if="${emp!=null}" th:value="${emp.id}">
最新回复(0)