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

Provide simple means to escape bean value expressions to prevent SpEL parsing

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      There appear to be no (documented) means to escape value expressions from being evaluated.
      There may be situations where #{} is included in a bean property value (such as a String containing ognl) which the developer wishes to keep as part of the value, rather than being evaluated by the container.
      This applies primarily to Strings rather than objects.

      My suggested solution would be to interpret a backslash in front of #{} or ${} as escapes, so that expressions with this prefix are not evaluated. The escaping backslash should be removed in the final result. If the backslash is part of the value, it needs to be escaped itself (
      ).

      Let me know if I have missed something or if such facility already exists (other than using something like #{' #

      {not evaluated}

      '})

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              ttimbul Thomas Timbul
              Last updater:
              Juergen Hoeller
            • Votes:
              6 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 35 weeks, 4 days ago