Skip to content
Advertisement

How to create a Map<String, List> property in properties file that can be injectable using Spring’s @Value

How do I create a Map<String, List<String>> property in properties file that can be injectable using Spring’s @Value?

Example code snippet in Properties java file

JavaScript

Advertisement

Answer

Here is the answer and the example code snippet in properties file:

JavaScript

Reference: https://stackabuse.com/the-value-annotation-in-spring/ section –> Injecting into Maps

Advertisement