正常情况下:
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**