Spring @Value leere Liste als Standard

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Spring @Value leere Liste als Standard

by Anonymous » 10 Feb 2025, 12:21

Gibt es eine Möglichkeit, eine leere Liste als Standardwert für eine Eigenschaft im Frühjahr festzulegen, so etwas wie: < /p>

@Value("${my.list.of.strings :" + new ArrayList() + "}")
private List myList;
< /code>

Offensichtlich nicht NeuarrayList, aber ich brauche stattdessen eine leere Liste. < /p>

Top