Java – spring: a bean that receives a list of classes
•
Java
I want to define a bean in my spring XML context, which has attributes of type list type: List < class > class
How do I send classes to beans, such as Java Lang.string and Java lang.Integer?
The list does not need to be reusable, i.e. I will not reference it in another bean
Solution
With spring, the simplest possibilities usually work
<property name="classes"> <list> <value>java.lang.String</value> <value>java.lang.Integer</value> </list> </property>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码