Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1
-
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); }