您的位置:首页 > 产品设计 > UI/UE

Failed to convert value of type...no matching editors or conversion strategy found

2016-02-23 22:54 507 查看
在使用springMvc做文件上传的时候出现 
HTTP Status 500 - Failed to convert value of type [java.lang.String] to required type [org.springframework.web.multipart.commons.CommonsMultipartFile]; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String]
to required type [org.springframework.web.multipart.commons.CommonsMultipartFile]: no matching editors or conversion strategy found


不知觉中的原因:



这里没有写method方法,
并且后台是用CommonsMultipartFile接受的。



这里要写清楚文件上传的形式。如果用get请求,数据是直接接在url后面,但是我们知道url里面是放不了多少数据的,
所以只有用post请求,将数据放置在消息体里。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: