[jira] [Created] (JEXL-311) Jxlt template scripts do not work when verbatim expressions are embedded in lambdas

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (JEXL-311) Jxlt template scripts do not work when verbatim expressions are embedded in lambdas

ASF GitHub Bot (Jira)
Henri Biestro created JEXL-311:
----------------------------------

             Summary: Jxlt template scripts do not work when verbatim expressions are embedded in lambdas
                 Key: JEXL-311
                 URL: https://issues.apache.org/jira/browse/JEXL-311
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 3.1
            Reporter: Henri Biestro
            Assignee: Henri Biestro
             Fix For: 3.2


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. 
{code:java}
      @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);
    }
{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)