Skip to content

Add support for default values in property placeholder syntax [SPR-4785] #9462

@spring-projects-issues

Description

@spring-projects-issues

Kenny MacLeod opened SPR-4785 and commented

I'd like to be able to specify the defaults for property placeholders within the placeholder itself, perhaps with something like this:

${my.property:myDefaultValue}

or something similar.

My use case is that often it is desirable to have to defaults alongside the placeholder, for readability. Also, our applications use a single, globally-defined placeholder configurer, and different instances of the application have different property sets, decoupled from the code itself. Embedding defaults within the placeholders would make this much easier to manage.


Affects: 2.5.4

Issue Links:

3 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions