错误: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. 10.6 ip:网络配置工具

    ip命令是iproute软件包中的一个强大的网络配置工具,用于显示或管理Linux系统的路由.网络设备.策略路由和隧道.   ip [option] [object] [command] ip [选项 ...

  2. 第六章 XaaS和IT服务标准

    从云计算(Cloud Computing)谈起 云计算是一种按使用量付费的模式,这种模式提供可用的.便捷的.按需的网络访问,进入可配置的计算资源共享池(资源包括网络,服务器,存储,应用软件,服务),这 ...

  3. STM32低功耗总结

    之前自己做过一个项目的低功耗大约11ua,那时总结下有几点: 1.外设时钟必须切换为内部时钟: 2.不用的外设全部关闭,要用再开就是了: 3.浮空引脚必须配置为下拉: 4.硬件上的上拉.下拉电阻切记不 ...

  4. Nextcloud 使用教程

    一.简介 Nextcloud是一个网盘式文件管理系统,多用户权限管理,多客户端,使用简单.可在浏览器中运行,也可下客户端,不论使用哪种方式运行,使用教程都是一样的. 只是在客户端中运行时能及时收到相应 ...

  5. .Net之简单通知服务

    开篇语 这两天看见有大佬分享使用钉钉和企业微信的机器人来做通知报警,然后我想到了我使用的另一个第三方软件捷易快信(可能大家都不知道这个东西,我也忘了我最开始是咋知道的),该服务的优点是可以通过微信进行 ...

  6. 摄像头标定GML Camera Calibration

    摄像头标定GML Camera Calibration GML Camera Calibration官方版是一款十分优秀出色的相机标定软件,GML Camera Calibration官方版界面友好, ...

  7. CodeGen用户定义的扩展令牌

    CodeGen用户定义的扩展令牌 用户定义的扩展令牌是一种特殊的令牌,开发人员可以确定令牌的名称以及在代码生成过程中遇到令牌时要插入的值. CodeGen支持多种机制,允许通过以下方式实现用户定义的令 ...

  8. 《python网络数据采集》笔记2

    1.网页表单与登陆窗口 Requests 库擅长处理那些复杂的 HTTP 请求.cookie.header(响应头和请求头)等内容. 1)表单提交 import requests #字段 params ...

  9. springboot——修改html实时生效,不用重启tomca(idea版)

    第一步: 在全局配置文件(application.properties)中禁用thymeleaf模板引擎的缓存,缓存是默认开启的 spring.thymeleaf.cache=false 第二步: 在 ...

  10. springMVC异常处理(自定义异常)HandlerExceptionResolver

    注:本篇的异常主要指的是controller.service和dao层中执行方法抛出的异常. 一.为什么要处理异常? 因为如果我们不处理异常,异常信息就会直接抛出给浏览器,于是浏览器页面就直接显示异常 ...