I am using below code to create a dynamic template -
Engine engine = Engine.builder().addDefaults().build();
Template t = engine.parse(" Dear:Your {obj.name}", null, "something");
Body obj = new Body();
obj.name = "ABC";
t.data("obj",obj).render()
I expect Dear:Your ABC as a result of the render. Instead I get, Dear:Your NOT_FOUND
If I do something like below it works as expected -
Template t = engine.parse(" Dear:Your {name}", null, "something");
t.data("name",name).render()
Somehow when qute templates are created with engine.parse, they are not able to understand the object as data. If I use the same contect with the html file injection as -
@Inject
Template something;
something.data("obj",obj).render();
This renders as expected. Any idea what am I doing wrong?