인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

jade043421620's profile image
jade043421620

asked

Spring MVC Part 2 - Backend Web Development Utilization Technology

Verification Direct Processing - Development

validation이 실행되기 전에 BindException에서 에러가 떠요

Written on

·

555

0

에러 코드는 다음과 같습니다.

Field error in object 'item' on field 'price': rejected value [1111a]; codes [typeMismatch.item.price,typeMismatch.price,typeMismatch.java.lang.Integer,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [item.price,price]; arguments []; default message [price]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Integer' for property 'price'; nested exception is java.lang.NumberFormatException: For input string: "1111a"]]

가격을 1000원 이하 또는 100만원 이상 등으로 type에러가 없는 경우에는 정상적으로 validation이 작동하는데 타입이 다른 경우에만 이렇게 에러가 발생합니다.

springMVC

Answer 1

0

안녕하세요. JY I님, 공식 서포터즈 OMG입니다.
1111a

를 입력하셨네요. 숫자만 입력하여 확인해주세요 ^^
감사합니다.

jade043421620's profile image
jade043421620

asked

Ask a question