-
스프링부트 에러 @PostMapping에러모음집 2023. 1. 9. 10:15
WARN 7012 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported]
package com.example.firstproject.controller; import com.example.firstproject.dto.ArticleForm; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; @Controller public class ArticleController { @GetMapping("/articles/new") public String newArticleFrom() { return "articles/new"; } @PatchMapping("/articles/create") public String createArticle(ArticleForm form){ System.out.println(form.toString()); return ""; } }
@PatchMapping가 아닌 @PostMapping를 써야 한다
'에러모음집' 카테고리의 다른 글
Error starting ApplicationContext. _스프링부트 (0) 2023.01.11 스프링 부트 에러 Execution failed for task (0) 2023.01.09 함수 에러_내 임의대로 만든 함수 (0) 2022.08.04 구구단 멍청한 에러 (0) 2022.07.19 set key error (0) 2022.07.12