Hi All,
I am working on uploading the image files in spring using the multipart file approach and i am not able to get through it successfully. I use CommonsMultipartResolver.
My POJO has these properties with accessor methods.
My bean definition for CommonsMultipartResolver is as followsCode:private MultipartFile imageFile; private MultipartFile thumbnailFile;
My view has the following defined.Code:<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
But i keep getting this error.Code:<form:form id="form" name="form1" commandName="campaign" method="post" action="savecampaign.html" enctype="multipart/form-data"> <legend>Images</legend><label>Thumbnail Image : </label> <input name="thumbnailFile" id="thumbnailFile" type="file" /> <form:errors path="thumbnailFile" /> <br /> <label>Item Image : </label> <input name="imageFile" type="file" id="itemImage" /> <form:errors path="imageFile" /> <br /> </form:form>
Failed to convert property value of type java.lang.String to required type org.springframework.web.multipart.MultipartFile for property thumbnailFile; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.web.multipart.MultipartFile] for property thumbnailFile: no matching editors or conversion strategy found
I am really confused if i am missing anything.


Reply With Quote