springboot 2.0中 PUT请求 接收不到参数解决办法

1,985 阅读1分钟

本来可以用HttpPutFormContentFilter这个类去解决的,但是在springboot2中 这类是deprecated 过期的。

经查询,被替代的类是FormContentFilter

所以解决办法如下:

@Configuration
@Slf4j
public class WebConfig extends WebMvcConfigurationSupport {


    @Bean
    public FormContentFilter formContentFilter() {
        return new FormContentFilter();
    }
}

经过上面的配置,就可以解决问题。