解决:1.首先检查测试软件的地址栏是否改成了delete请求,因为地址栏输入链接默认都是get请求方式,所以大多数时候会忽略这个问题:
2.有可能在 Spring Boot 的 META-INF/spring-configuration-metadata.json 配置文件中,默认是关闭 Spring 的 hiddenmethod 过滤器的,所以直接在表单提交的数据中添加 "method" 数据并不起作用。
在 Spring Boot 的配置文件 application.properties 中将 hiddenmethod 过滤器设置为启用即可。
spring.mvc.hiddenmethod.filter.enabled=true