错误:org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.List]: Specified class

这是我使用Spring MVC的时候出的错误,在前台将多个信息的id封装成一个集合后传递到控制层,向让这些id自动映射到控制层方法的参数上

我这个参数是一个List类型,因为Spring MVC是不能这样直接映射到集合类型的参数的,我们需要将这个集合类型的参数封装到一个类中,下面举个例子:

前台封装好的id集合名称:ids,

映射到控制层的方法:

1 @requestMapping("/test")
2 public void test(TestVo testVo) throws ExcepTion{
3
4 // 你的代码
5 }

TestVo类(我们的封装类)

1 public class TestVo {
2
3 private List ids; // 接收前台传递的多个id,属性名称一定要和前台传递的id集合的名称相同
4
5 // ids的setter和getter方法,这个必须要有,我在这里就不写了
6
7 }

学习不能停,各位加油!

org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.List]: Specified class的更多相关文章

  1. springmvc上传文件报错org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]

    在用springmvc+mybatis进行项目开发时,上传文件抛异常... org.springframework.beans.BeanInstantiationException: Could no ...

  2. org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.hs.model.StudentModel]: No default constructor found; nested exception is java.lang.NoSuchMethodException: c

    root cause org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [c ...

  3. Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.liuyang.JDbCTemplate.PersonDao]: No default constructor fo

    错误是说我的配置文件中没有对构造函数进行配置,所以找不到构造函数,在配置文件application.xml中加入如下句子: <bean id="personDao" clas ...

  4. 【FAQ】SpingMVC实现集合參数(Could not instantiate bean class [java.util.List])

    需求,要求批量新增或者改动一个List,在Spring MVC中是不支持以下代码的写法 @RequestMapping(value = "/update", method = Re ...

  5. SpingMVC实现集合参数(Could not instantiate bean class [java.util.List])

    需求,要求批量新增或者修改一个List,在springMVC中是不支持下面代码的写法: @RequestMapping(value = "/update", method = Re ...

  6. 【spring mvc】后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface

    后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate ...

  7. Could not instantiate bean class [java.util.List]: Specified class is an interface] with root cause

    最近项目中页面比较复杂,springMVC传参过程中遇到这样一个错误:Could not instantiate bean class [java.util.List]: Specified clas ...

  8. org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jboss.resteasy.plug

    之前做的项目是resteasy的上传,代码没有问题,断点都不进来呢. 我以为可以直接移植到SpringMVC,但是SpringMVC不支持MultipartFormDataInput , 用Multi ...

  9. Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException

    错误提示: defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean ...

随机推荐

  1. MyBatis 数据源的原理和机制

    回顾JDBC JDBC访问数据库流程 加载驱动 获取Connection连接对象(消耗性能) 获取PrepareStatement对象 执行SQL语句 获取结果集 关闭Connection连接对象 存 ...

  2. JavaEE 学大数据是否掌握 JavaSE 和 Linux 就够了?

    引言 如果你是学习大数据的童靴,可能经常在网上看到一些公众号或博客告诉你,学习大数据基础部分只需要掌握 JavaSE 和 Linux 就够了,至于 JavaWeb 和 JavaEE 简单了解一下就可以 ...

  3. 1.5linux用户权限相关命令

    用户权限相关命令 目标 用户 和 权限 的基本概念 用户管理 终端命令 组管理 终端命令 修改权限 终端命令 01. 用户 和 权限 的基本概念 1.1 基本概念 用户 是 Linux 系统工作中重要 ...

  4. linux 创建网桥

    由于最近项目需验证个问题,需求是要创建一个虚拟机网桥,在使用ifconfig命令查看时让docker0网桥不在第一个显示,因此,我们创建一个虚拟网桥让它排在第一位置 项目使用Centos7系统,因此使 ...

  5. 加载动画效果 HTML+ CSS

    加载动画效果 写在前面 在无限的时间的河流里,人生仅仅是微小又微小的波浪.--郭小川 实现效果 实现原理 通过2个伪元素来设置3条颜色边框 通过定位将3个圆弧边框层叠再一起,再通过旋转实现一个圆的效果 ...

  6. 写Bug时,需要注意的几点3

    在对象之间搬移特性 类往往会因为承担过多责任而变得臃肿不堪. (Move Method)搬移函数 含义:在程序中,里面的一个函数与其类外面的一个类或函数有着紧密的调用或者被调用,则需要对其函数内部的表 ...

  7. 在Maven普通项目上添加Web app的支持

    项目右键____> Add Frameworks Support

  8. Go语言协程并发---timer秒表与定时器

    秒表 package main import ( "fmt" "time" ) /*每秒大喊我要去浪,共9次,然后退出计时*/ func main() { va ...

  9. GO语言面向对象01---封装属性与创建对象的方法与工厂模式

    package main import "fmt" /* 面向过程编程:调度大量的变量.函数 ---------- 面向对象编程(OOP=Object Oriented Progr ...

  10. c++ 各种数据结构的时间空间复杂度

    普通线段树    时间 log2(n); 空间 n+log2(n)+log4(n)+log(8)n+.....+logn(n)==n*4; 动态开点线段树 时间 log2(n); 空间 q*log2( ...