diff --git a/spring-framework-reference/src/expressions.xml b/spring-framework-reference/src/expressions.xml index 20ff8f1d58..e31e9103f5 100644 --- a/spring-framework-reference/src/expressions.xml +++ b/spring-framework-reference/src/expressions.xml @@ -1011,6 +1011,15 @@ tesla.setPlaceOfBirth(null); city = parser.parseExpression("PlaceOfBirth?.City").getValue(context, String.class); System.out.println(city); // null - does not throw NullPointerException!!! + + The Elvis operator can be used to apply default values in + expressions, e.g. in an @Value expression: + + @Value("#{systemProperties['pop3.port'] ?: 25}") + + This will inject a system property pop3.port if it + is defined or 25 if not. +