Tapestry 5
  1. Tapestry 5
  2. TAP5-1605

Template parsing of expansions can't handle map expressions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development