<p>Title</p>
#if (condition)
<p>Some message</p>
#end
My java method looks something like:
**public String getTemplateContents(Context context, String template)** {
StringWriter w = new StringWriter();
Template t = Velocity.getTemplate(template);
template.merge(context, w);
String s = w.toString();
w.close();
return s;
}
Currently, s only returns the output:
<p>Title</p>
I would like it to output the whole vm template contents:
<p>Title</p>
#if (condition)
<p>Some message</p>
#end
I have also tried using the mergeTemplate method with no success. Please help.