SpringBoot 2.2.X默认不支持put,delete等请求方式的。

首先需要在配置文件中打开他们,代码如下:

spring.mvc.hiddenmethod.filter.enabled=true

然后在form标签里面声明method为post

最后在form里面使用以下标签

<input th:type="hidden" name="_method" value="put">

name必须为“_method”,value值就是你想使用的请求方式,put或者delete等

相关文章:

  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案