728x90
반응형


런타임 오류 내용입니다.

 
org.springframework.validation.BeanPropertyBindingResult: 2 errors Field error in object 'cri' on field 'page': rejected 
value []; codes [typeMismatch.cri.page,typeMismatch.page,typeMismatch.int,typeMismatch]; arguments 
[org.springframework.context.support.DefaultMessageSourceResolvable: codes [cri.page,page]; arguments []; default 
message [page]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for 
property 'page'; nested exception is java.lang.NumberFormatException: For input string: ""] Field error in object 'cri' on 
field 'perPageNum': rejected value []; codes
[typeMismatch.cri.perPageNum,typeMismatch.perPageNum,typeMismatch.int,typeMismatch]; arguments 
[org.springframework.context.support.DefaultMessageSourceResolvable: codes [cri.perPageNum,perPageNum]; 
arguments []; default message [perPageNum]]; default message [Failed to convert property value of type 
'java.lang.String' to required type 'int' for property 'perPageNum'; nested exception is 
java.lang.NumberFormatException: For input string: ""]

 


게시판 수정 중 컨트롤러에서 value=""빈칸으로 발생하여 sumbit시에 값을 읽지 못해 발생한 오류입니다.

컨트롤러에서 @ModelAttribute를 명시해주지 않아서 생긴 오류였습니다.

@RequestParam이나 @MddelAttribute 어노테이션을 사용하면 메소드의 길이가 길어지고 복잡하다고 느낄 수 있습니다.

하지만 이를 생략하는 것은 저처럼 오류를 범할 수 있으니 꼭 명시해주는게 좋습니다.


728x90
반응형

+ Recent posts