How to XML configure Spring bean for constructor injection when bean has varargs constructor
Posted
by hamletdarcy
on Stack Overflow
See other posts from Stack Overflow
or by hamletdarcy
Published on 2009-04-15T12:01:58Z
Indexed on
2010/05/20
15:10 UTC
Read the original article
Hit count: 561
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
}
}
© Stack Overflow or respective owner