Org.springframework.beans.BeanInstantiationException:Could not instantiate Bean class [java.util.List]: Specified Class

Source: Internet
Author: User

Error: Org.springframework.beans.BeanInstantiationException:Could not instantiate Bean class [java.util.List]: Specified Class

This is an error when I use spring MVC, which is passed to the control layer after the foreground encapsulates the IDs of multiple information into a collection, to the parameters that automatically map these IDs to the control layer methods


This parameter is a list type, because spring MVC is not directly mapped to the parameters of the collection type, we need to encapsulate the parameters of this collection type in a class, for example:

ID collection name of the foreground package: IDs,

Methods to map to the control layer:

1 @requestMapping ("/test")2publicvoidthrows  exception{  34//  Your code 5 }

Testvo Class (Our encapsulation Class)

1  Public class Testvo {23private List IDs;    // receive multiple IDs passed by the foreground, and the property name must be the same as the name of the ID collection passed by the foreground 4 5 // IDs Setter and getter method, this must have, I do not write here 6 7 }

Study can not stop, everyone refueling!

Org.springframework.beans.BeanInstantiationException:Could not instantiate Bean class [java.util.List]: Specified Class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.