In the current documentation - about @Value by applying default values, assuming that the host.ipv6 key does not exist

Therefore for Spring 6 working with @Value and without SpeL such as:

@Value("${host.ipv6:not defined}")
@Value("${host.ipv6?:not defined}")

Both work by returning not defined as expected - it as the default value.

What is not clear in the current documentation: When is mandatory : and ?: each one over the other?

There are more details about this ... please see the following SO post:

Thanks for your understanding

Comment From: snicoll

Thanks for the suggestion but I don't think we need to do anything. The current section of the documentation is already pretty explicit about what to do. It states how you can specify a default value and that SpEL is also possible. The elvis operator is actually using SpEL.