How to XML configure Spring bean for constructor injection when bean has varargs constructor


How to XML configure Spring bean for constructor injection when bean has varargs constructor



Is there a way to write a Spring bean in XML so that it uses constructor injection when that constructor has a varargs parameter type? IE, is there a way to specify an array the way you can specify a list?

For instance:

class MyClass {     MyClass(String... args) {         // rest omitted     } } 



how to make java enum elements configurable

1:



Spring RDBMS vs JDBCTemplate
since args is an array of String you can use <list>:.
Convert XML based configuration to Annotations [closed]
 <bean name="myBean" class="MyClass">     <constructor-arg>         <list>             <value>111</value>             <value>222</value>             <value>333</value>             <value>444</value>         </list>     </constructor-arg> </bean> 


How to log the time taken by methods in Springframework?


80 out of 100 based on 40 user ratings 590 reviews