Java – spring: a bean that receives a list of classes

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
分享
二维码
< <上一篇
下一篇>>