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

Provide a way to disable nested resolution of property placeholders

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.1.2
    • Fix Version/s: None
    • Component/s: None
    • Last commented by a User:
      true

      Description

      There should be a way to use <context:property-placeholder /> to bind a value without trying to evaluate nested values.

      For example, I'd like to bind a value that contains a MessageFormat pattern like this one:

      my.property={0}#{1}
      

      (very simple case that shows the problem)

      This # is a separator between the first argument {0} and the second one, {1}.
      Of course, #{1} have no value in my context.

      Then, I do :

      <context:property-placeholder location="..." />
      <bean id="myBean" class="my.class">
          <property name="myProp" value="${my.property}" />
      </bean>
      

      I need the property evaluation to not to try to be smart and just replace ${my.property} with it's value.

      Instead it blows up, replacing #{1} by its value "".

        Attachments

          Activity

            People

            Assignee:
            pwebb Phil Webb
            Reporter:
            mleduque Mickaƫl LEDUQUE
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 24 weeks, 1 day ago