Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1605

Template parsing of expansions can't handle map expressions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      5.3 introduced map support into the property expression language in the form:

      {'foo': 'bar'}

      .

      Expansion parsing chokes on the syntax, however. It uses a reluctant regular expression to find the closing brace:

      private static final Pattern EXPANSION_PATTERN = Pattern.compile("\\$

      {\\s*(.*?)\\s*}

      ");

      Which means that the use of a map inside an expansion prematurely terminates the exansion:

      ${echoMap(

      {"foo": "bar"}

      )}

      The regex finds the first } and the expression evaluates as:

      echoMap({"foo": "bar"

      Which is clearly incorrect.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ongakugainochi Robert Zeigler
                Reporter:
                ongakugainochi Robert Zeigler
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: