Can we write Spring bean in XML and configure it? so that it uses constructor injection when that constructor has a variable argument parameter type?
For example
class DemoClass{
MyClass(String... args) {
}
}
CodePudding user response:
<bean name="demoBean" >
<constructor-arg>
<list>
<value>101</value>
<value>102</value>
<value>103</value>
<value>104</value>
</list>
</constructor-arg>
</bean>