Spring Boot 表单无法发送PUT、DELETE请求
在表单中创建
<input type="hidden" name="_method" value="PUT" th:if="${emp!=null}">
后依旧无法发送PUT请求,原因是springBoot默认关闭了MVC的HiddenHttpMethodFilter,因此需要打开。
打开方式:在application.properties中添加:
# 开启mvc的HiddenHttpMethodFilter,以便可以表单可以发送PUT、DELETE等请求 spring.mvc.hiddenmethod.filter.enabled=true

浙公网安备 33010602011771号