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请求,将数据放置在消息体里。
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请求,将数据放置在消息体里。
相关文章推荐
- UIColectionView实现无限滚动(图片轮播)
- ios-UI控件精讲之【3】-UIWindow
- mybaties注解requestParam("id") String[] ids
- UIView基础笔记
- RabbitMQ Exchange & Queue Design Trade-off
- LeetCode-304. Range Sum Query 2D - Immutable
- [Locked] Verify Preorder Sequence in Binary Search Tree
- 使用phantomjs进行无界面UI自动化测试
- sequence有关问题
- hdu3530Subsequence【单调队列优化dp】2010多校联合
- 334. Increasing Triplet Subsequence【M】【69】
- STL_queue
- ios不同版本下的UILabel自动换行问题
- STL_deque
- 1101. Quick Sort (25)
- UITableViewControl的编辑(删除,添加,移动)
- IOS-53-图片、button等空间是否可拉伸设置;以及UITabelView的headerView设置
- 等待控件(UIActivityIndicatorView)不转动的原因
- Universal-Image-Loader(UIL)图片加载框架使用简单介绍
- IOS-52-UITableView中cell分割线左对齐(解决iOS8版本适配问题)