Spring PUTメソッドが認識されない場合

投稿者:

Thymeleafでは、フォームタグのmethod属性を直接PUTに設定することはできません。ただし、th:method属性を使ってフォームをPUTメソッドとして扱うことは可能です。Thymeleafのバージョンによっては、th:method属性を使うことで実際にPUTリクエストとして送信されるように設定できることもあります。

Thank you for reading this post, don't forget to subscribe!
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.HiddenHttpMethodFilter;

@Configuration
public class WebConfig {
    @Bean
    public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
        return new HiddenHttpMethodFilter();
    }
}