Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-311

Jxlt template scripts fail using verbatim expressions embedded in lambdas

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None

    Description

      It seems lambdas in template break the template interpreter. Quick analysis shows the jexl namespace is not solved, the symbols are not recognised as such.

      The following test should work. 

            @Test
          public void test311a() throws Exception {
              JexlContext ctx = null;
              String rpt
                      = "$$((a)->{\n"
                      + "<p>Universe ${a}</p>\n"
                      + "$$})(42)";
              JxltEngine.Template t = JXLT.createTemplate("$$", new StringReader(rpt));
              StringWriter strw = new StringWriter();
              t.evaluate(ctx, strw);
              String output = strw.toString();
              Assert.assertEquals("<p>Universe 42</p>\n", output);
          }
      

      Attachments

        Activity

          People

            henrib Henri Biestro
            henrib Henri Biestro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: