Skip to content

Commit f674f12

Browse files
retroqyetanotherallisonf
authored andcommitted
BAEL-748 updated Quick Guide to @value (eugenp#1663)
* BAEL-748 quick guide to @value * BAEL-748 changes from review * BAEL-748 inject comma-separated values into array
1 parent 74688cf commit f674f12

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎spring-core/src/main/java/com/baeldung/value/ValuesApp.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.baeldung.value;
22

3+
import java.util.Arrays;
34
import java.util.List;
45

56
import javax.annotation.PostConstruct;
@@ -30,6 +31,9 @@ public class ValuesApp {
3031
@Value("${priority}")
3132
private String prioritySystemProperty;
3233

34+
@Value("${listOfValues}")
35+
private String[] valuesArray;
36+
3337
@Value("#{systemProperties['priority']}")
3438
private String spelValue;
3539

@@ -60,6 +64,7 @@ public void afterInitialize() {
6064
System.out.println(systemValue);
6165
System.out.println(someDefault);
6266
System.out.println(prioritySystemProperty);
67+
System.out.println(Arrays.toString(valuesArray));
6368
System.out.println(spelValue);
6469
System.out.println(spelSomeDefault);
6570
System.out.println(someBeanValue);

0 commit comments

Comments
 (0)