Announcement Announcement Module
Collapse
No announcement yet.
Loading a list from properties file using @Value annotation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading a list from properties file using @Value annotation

    Hello,

    I couldn't find what I need in other topics so I hope someone could help me...

    I'm trying to load a list of String using @Value annotation and a properties file.

    My java code looks like :

    Code:
    @Value("${my.list.of.strings}")
    private List<String> myList;
    and my properties file :
    Code:
    my.list.of.strings=1;2;3;4;5
    But all I am getting is a java list containing only one String which is "1;2;3;4;5"

    How could I make this work ? Is that even possible ?

    Thank you in advance

    Peipsy
Working...
X