正常情况下:
1、SpringMVC中配置HiddenHttpMethodFilter;(SpringBoot自动配置好的)
2、页面创建一个post表单
3、创建一个input项,name="_method";值就是我们指定的请求方式
而在springboot2.x中,hiddenmethod 多了个条件注解,默认是关闭这个过滤器的
源码中:
@ConditionalOnProperty(prefix = "spring.mvc.hiddenmethod.filter", name = "enabled", **matchIfMissing = false**)
所以解决方法是在配置文件application.properities中加入开启过滤器的代码:
**spring.mvc.hiddenmethod.filter.enabled=true**
本文详细介绍了在SpringBoot 2.x中如何正确配置HiddenHttpMethodFilter,以实现HTTP请求方法的转换。由于默认情况下该过滤器被禁用,文章提供了在application.properties中启用它的具体步骤。

被折叠的 条评论
为什么被折叠?



