That will work if you create a context field $tpl first. Actually, I
haven't yet used the evaluate method, so I'll just assume you have the
correct format.
String $tpl="template.vm";
ctx.put("tpl",tpl);
String incTpl = "#include($tpl)";
Writer w = new StringWriter();
velocityEngine.evaluate(ctx, w, "", incTpl);
String vtl = w.toString();
Barbara Baughman
X2157
On Thu, 20 May 2004, Ford, Peter wrote:
> That might work...
>
> I could do this in my code:
>
> String incTpl = "#include($" + tpl + ")";
> ..
> Writer w = new StringWriter();
> velocityEngine.evaluate(ctx, w, "", incTpl);
> String vtl = w.toString();
>
> I'll try this.
>
> Thanks!
>
> --Pete
>
> > -----Original Message-----
> > From: Barbara Baughman [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 20, 2004 2:35 PM
> > To: Velocity Users List
> > Subject: Re: How to get unprocessed template from VelocityEngine?
> >
> >
> > How about creating a template display.vm that looks like
> > #include($template)
> >
> > where $template is the name of the velocity template you want to
> > display. The include directive does not parse, so you don't have to
> > do anything fancy to get that output.
> >
> > Barbara Baughman
> > X2157
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]