samskivert / jmustache

A Java implementation of the Mustache templating language.
Other
834 stars 128 forks source link

{{parent.child.0.field}} it not resolved if child is java.util.Set (instead of java.util.List) #93

Closed anandchakru closed 6 years ago

anandchakru commented 6 years ago

Template: {{parent.child.0.field}}

context:

Mustache.Compiler c = Mustache.compiler();
Parent parentObj = new Parent();
Map<String, Object> ctx = Maps.newHashMap();
ctx.put("parent", parentObj);
c.compile(templateHtml).execute(ctx);

Exception:

"exception" : "com.samskivert.mustache.MustacheException$Context",
  "message" : "Missing context for compound variable 'parent.child.0.field' on line 1. '0' was not found."
anandchakru commented 6 years ago

Closing this. Please refer SO for deteails