org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.util.List]: Specified class
错误: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的更多相关文章
- springmvc上传文件报错org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]
在用springmvc+mybatis进行项目开发时,上传文件抛异常... org.springframework.beans.BeanInstantiationException: Could no ...
- 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 ...
- 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 ...
- 【FAQ】SpingMVC实现集合參数(Could not instantiate bean class [java.util.List])
需求,要求批量新增或者改动一个List,在Spring MVC中是不支持以下代码的写法 @RequestMapping(value = "/update", method = Re ...
- SpingMVC实现集合参数(Could not instantiate bean class [java.util.List])
需求,要求批量新增或者修改一个List,在springMVC中是不支持下面代码的写法: @RequestMapping(value = "/update", method = Re ...
- 【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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- GNU Linux启动时文件系统mountall挂载出错问题的处理
/********************************************************************* * Author : Samson * Date ...
- svg 飞线,源码
<html> <head> <meta charset="utf-8" /> <meta name="viewport" ...
- MIPS指令的CPU实现:ALU设计
设计CPU的第一步,设计一个简单的逻辑运算单元ALU.同时对Verilog语言也有一定要求. 一.实验内容 如图,ALU接受两个N位的输入,得到N位的输出,通过控制信号F决定运算功能. 将ALU的输出 ...
- 安卓开发(2)—— Kotlin语言概述
安卓开发(2)-- Kotlin语言概述 Android的官方文档都优先采用Kotlin语言了,学它来进行Android开发已经是一种大势所趋了. 这里只讲解部分的语法. 如何运行Kotlin代码 这 ...
- TODO不实现会报错
kotlin.NotImplementedError: An operation is not implemented: Not yet implemented 会发生--当你 override fu ...
- 微信小程序setdata修改数组或对象
1.this.setdata修改数组的固定一项的值 changeItemInArr: function() { this.setData({ 'arr[0].text':'changed data' ...
- xss-代码角度理解与绕过filter
0x00 原理 xss全称为cross site scripting,中文为跨站脚本攻击.它允许web用户将恶意代码植入到提供给用户使用的页面.代码包括HTML代码和客户端脚本. 0x01 危害 ...
- es 查询更新操作
# es 查询更新操作# _*_ coding: utf-8 _*_ import time import datetime import pymysql from elasticsearch imp ...
- redis中AOF和RDB的关闭方法
redis中AOF和RDB的关闭方法 问题:当往redis中导入数据时,有时会出现redis server went away的情况: 原因: 导入的数据量太大,而内存不够(即内存1G,但数据有2 ...
- Go基础结构与类型04---基本数据类型
package main import "fmt" func main() { //整型 var a byte = 123 var b rune = 123 var c int = ...