我是靠谱客的博主 如意酒窝,这篇文章主要介绍Failed to convert value of type...no matching editors or conversion strategy found,现在分享给大家,希望可以做个参考。
在使用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请求,将数据放置在消息体里。
最后
以上就是如意酒窝最近收集整理的关于Failed to convert value of type...no matching editors or conversion strategy found的全部内容,更多相关Failed内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复