Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-4785

Add support for default values in property placeholder syntax

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.4
    • Fix Version/s: 3.0 RC1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                skaffman Kenny MacLeod
                Last updater:
                Trevor Marshall
              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  8 years, 31 weeks, 6 days ago