I've created a class that implements TemplateMethodModelEx from FreeMarker. Pretend the exec() function returns a String: "Hello ${username}"
I assign the class to a method in the data model:
dataModel.put("myMethod", myClassInstance);
dataModel.put("username", "John Doe");
My HTML template looks like this:
<p>${myMethod()}</p>
Which means that the following output is generated, when the template is processed:
<p>Hello ${username}</p>
Since there is actually a username value in my data model, I'd rather want the output to be:
<p>Hello John Doe</p>
How do I tell FreeMarker to parse the result of myMethod()? I tried both ?eval and ?interpret and both fail to accomplish what I want. Is this possible with FreeMarker?
[#ftl]or<#ftl>? freemarker.org/docs/ref_directive_ftl.html - m-szalik