공부/JAVA | JSP&Servlet | Spring

spring 파일 업로드 에러 org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'boardVO' on field 'uploadFile': rejected value []; codes

bumcrush 2019. 3. 25. 16:21
반응형

spring 파일 업로드 에러 

org.springframework.validation.BeanPropertyBindingResult: 

1 errors Field error in object 'boardVO' on field 'uploadFile': rejected value []; codes 



에러 메시지

Message: org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'boardVO' on field 'uploadFile': rejected value []; codes [typeMismatch.boardVO.uploadFile,typeMismatch.uploadFile,typeMismatch.org.springframework.web.multipart.MultipartFile,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [boardVO.uploadFile,uploadFile]; arguments []; default message [uploadFile]]; default message [Failed to convert property value of type [java.lang.String] to required type [org.springframework.web.multipart.MultipartFile] for property 'uploadFile'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.web.multipart.MultipartFile] for property 'uploadFile': no matching editors or conversion strategy found] 



원인 / 해결

insertForm.jsp에서 오타


<form action="insertBoard.do" method="post" enctype="mulipart/form-data">

아래로 수정


<form action="insertBoard.do" method="post" enctype="multipart/form-data">



참고 사이트

https://okky.kr/article/545488




  • 현재글spring 파일 업로드 에러 org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'boardVO' on field 'uploadFile': rejected value []; codes