스프링부트 2.5에서 회원가입 시 유효성 검사를 위해
@Valid를 붙여서 검사를 진행하는데
로직은 전혀 문제가 없음에도 불구하고
계속 400에러가 떴다.
원인
@Valid어노테이션이 붙은 파라미터 바로 뒤에 BindingResult가 없기 때문이다.
해결방법
@Valid어노테이션이 붙은 파라미터 바로 뒤에 BindingResult 파라미터 넣어주기
잘못된 예시
올바른 예시
출처
https://stackoverflow.com/questions/17084400/spring-error-400-during-validation
Spring. Error 400 during validation
Here is an issue I have been stuck into. Actually, I implemented all required features in order to get couple of my field validated, however I still get that 400 error. I even compared what I have ...
stackoverflow.com
'에러 해결' 카테고리의 다른 글
Field 'id' doesn't have a default value 에러 해결 (0) | 2021.12.14 |
---|---|
junit5 failed to load applicationcontext 에러 해결 (0) | 2021.12.13 |
intellij 디렉토리 옮긴 후 클래스 import 에러 (0) | 2021.11.21 |
Mysql 프로시저 만들때 to your MySQL server version for the right syntax to use near 에러 (0) | 2021.11.10 |
Querydsl Error:java: Attempt to recreate a file for type 에러 (0) | 2021.11.08 |