Spring/Spring

[Spring 스프링] Http status 에러 405 Method Not Allowed

ghyeong 2021. 6. 22. 15:22
반응형

HTTP 상태 에러 코드중에 405에러가 나왔습니다.

 

콘솔 에러에서 잡힌 로그 

Resolved exception caused by handler execution: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported

친절하게도 POST를 지원하지 않는다라고 합니다.

브라우저에서 호출할때 POST로 호출하고

Controller에서는 당당히 


@RequestMapping(value = "호출URL.do", method = RequestMethod.GET)

'매핑하여 받는 주소에 대한 method를 GET으로 지정해서 POST 방식으로 지정해서 Request를 받아라'라고 GET은 허용불가하다. 라고 에러를 보여주는겁니다.

 

이럴때는 Controller나 호출부분에 대한 메소드를 POST,GET에 맞게끔 변경하거나 모두 선언하는 방식으로 고쳐주세요

 

 

 

 

반응형