解决Failed to instantiate [java.util.List]: Specified class is an interface问题
来源:互联网 发布:什么是网络谣言 编辑:程序博客网 时间:2024/06/05 08:20
错误信息提示
Failed to instantiate [java.util.List]: Specified class is an interface;
错误信息意思:
参数错误,参数封装出了问题。
错误时java代码
前端给后台传递了一个list对象,本来以为直接用list 可以接收,但是运行方法报错,参数错误。
查询错误问题,发现是前端传递的对象,后台没有set,get的实体接收。
controller中参数List内封装的不是基本数据类型,而是一个对象,springMVC源码获取前台的参数是:request.getParameter("")来接收参数的,这样的话,封装参数时就出问题了。
解决办法:
将VO对象再进行封装:
换一个专门存放想要接受的实体的javaBean,定义方式如下:
这样就可以接收到 从前端传递过来的 list<Attachment> 对象。
谢谢观看
2 0
- 解决Failed to instantiate [java.util.List]: Specified class is an interface问题
- 解决Failed to instantiate [java.util.List]: Specified class is an interface问题
- SpringMvc报错解决:Failed to instantiate [java.util.List]: Specified class is an interface
- 关于运行期异常:Failed to instantiate [java.util.List]: Specified class is an interface
- 关于运行期异常:Failed to instantiate [java.util.List]: Specified class is an interface
- 关于运行期异常:Failed to instantiate [java.util.List]: Specified class is an interface
- Failed to instantiate [java.util.List]: Specified class is an interface
- 错误:Could not instantiate bean class [java.util.List]: Specified class is an interface
- Could not instantiate bean class [java.util.List]: Specified class is an interface
- Failed to instantiate [org.springframework.data.domain.Pageable]: Specified class is an interface
- Failed to instantiate [org.springframework.data.domain.Pageable]: Specified class is an interface
- springMVC接受list报错:Could not instantiate bean class [java.util.List]: Specified class is an interf
- Specified class is an interface
- Specified class is an interface
- mybatis报错:Could not instantiate bean class [Dao.stuDao]: Specified class is an interface
- Could not instantiate bean class [javax.servlet.ServletContext]: Specified class is an interface
- Mybatis,Specified class is an interface
- springboot Mapper: Specified class is an interface
- Android各种键盘挡住输入框解决办法
- Python数据分析(一)
- Javacv调用摄像头采集图像
- ubunu安装libsvm
- Material Design
- 解决Failed to instantiate [java.util.List]: Specified class is an interface问题
- CSDN上的第一篇博客
- Mysql 为表添加外键约束
- LeetCode#12. Integer to Roman
- linux内核软中断引起大量丢包
- C#里面设置ListView单列(某个单元格的样式:颜色和字体等)。
- centos7 docker
- Json字符串和js对象之间的转换
- iOS 利用token保持登陆状态