错误: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. Git 系列教程(14)- 远程分支

    远程分支 远程引用是对远程仓库的引用(指针),包括分支.标签等等 你可以通过 git ls-remote <remote> 来显式地获得远程引用的完整列表 polo@B-J5D1MD6R- ...

  2. 『居善地』接口测试 — 7、Requests库使用proxies代理发送请求

    目录 1.代理的了解 2.代理的分类 (1)正向代理 (2)反向代理 (3)总结 3.Requests库使用代理 4.总结 1.代理的了解 在上图中我们可以把Web server看成是Google服务 ...

  3. 77GHz 和24GHz Radar性能解析

    77GHz 和24GHz Radar性能解析 一.77GHz MRR 77GHz MRR Automotive Collision Warning Radar Application MRR – Fo ...

  4. 第五周 Spring框架

    一.Spring框架设计 Spring framework 6大模块 1.1 Spring AOP AOP: 面向切面编程 Spring 早期版本的核心功能,管理对象声明周期和对象装配 为了实现管理和 ...

  5. Spring Cloud系列(三):服务消费与负载均衡

    上一篇介绍了服务提供者,有了注册中心和服务提供者,我们就可以进行服务消费了.Spring Cloud可以通过RestTemplate+Ribbon和Feign这两种方式消费服务. 我们仍然在上一篇的项 ...

  6. 1482. 制作 m 束花所需的最少天数

    2021-05-09 LeetCode每日一题 链接:https://leetcode-cn.com/problems/minimum-number-of-days-to-make-m-bouquet ...

  7. 四、SSL虚拟证书

    沿用练习三,配置基于加密网站的虚拟主机,实现以下目标: 域名为www.c.com 该站点通过https访问 通过私钥.证书对该站点所有数据加密 4.2 方案 源码安装Nginx时必须使用--with- ...

  8. Jenkins 安装使用笔记

    系统要求 最低推荐配置: 256MB可用内存 1GB可用磁盘空间(作为一个容器docker运行jenkins的话推荐10GB) 为小团队推荐的硬件配置: 1GB+可用内存 50 GB+ 可用磁盘空间 ...

  9. 带你了解Java的序列化与反序列化

    什么是序列化 序列化:将 Java 对象转换成字节流的过程. 什么是反序列化 反序列化:将字节流转换成 Java 对象的过程. 序列化的实现 当 Java 对象需要在网络上传输 或者 持久化存储到文件 ...

  10. MySQL 面试必备:又一神器“锁”,不会的在面试都挂了

    1 什么是锁 1.1 锁的概述 在生活中锁的例子多的不能再多了,从古老的简单的门锁,到密码锁,再到现在的指纹解锁,人脸识别锁,这都是锁的鲜明的例子,所以,我们理解锁应该是非常简单的. 再到MySQL中 ...