velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: List of variables present in the template?
Date Tue, 27 Nov 2001 13:45:43 GMT
On 11/27/01 5:35 AM, "JD Evora" <> wrote:

>> No, but at this rate, I am going to write one.  This is the second request
>> for this in a week.
>> It will be simple and quick to do...
>> Why do you want this, if I may ask?
> I am generating messages merging Velocity templates that the user creates
> on the fly with CSV files.
> I would like to generate a report that includes only the fields that were
> used in the template.
> After looking without success for something like Template.getVariables(), I
> just parsed the template by myself.

Ok done.

It's a simple little tool, found in contrib/temporary/TemplateTool (this
doesn't belong in the core, in my opinion...) and you can use it to get a
list of all the references in a template (and also counts of each

There is a little main() method that demonstrates how to use it, so I won't
do it here.

Geir Magnusson Jr.                           
System and Software Consulting
Be a giant.  Take giant steps.  Do giant things...

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message