MVEL
  1. MVEL
  2. MVEL-70

Templating syntax doesnt match documentation.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.22
    • Component/s: Templating
    • Labels:
      None
    • Number of attachments :
      1

      Description

      MVEL attempts to evaluate anything preceded by an @ symbol, whether or not the following text is contained in curly braces. The behaviour doesnt appear to be as described in the documentation.

      For example, evaluating the following template causes an error (assuming there is no object called smith in context)...

      String template = "my email is john@smith.com";
      String result = TemplateInterpreter.evalToString(template, rootObject, map);

      However, the documentation at http://mvel.codehaus.org/Templating+Basics says...

      "Orb tags are comprised of a preceding @ character, followed by

      {...}

      brackets which contain regular MVEL expressions."

      This suggests that curly braces are required for template text to be considered an expression.

      Given that @ symbols are extremely common in content i suggest modifying the behaviour to match the documentation, rather then the other way around.

        Activity

        Mike Brock made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        brad mcevoy made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Cannot Reproduce [ 5 ]
        brad mcevoy made changes -
        Attachment testcase.zip [ 31841 ]
        Mike Brock made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        Mike Brock made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mike Brock made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mike Brock made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Mike Brock made changes -
        Fix Version/s 1.2.22 [ 14003 ]
        Mike Brock made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]

          People

          • Assignee:
            Mike Brock
            Reporter:
            brad mcevoy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: