velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Hendler" <>
Subject Re: Which variables are involved in a template?
Date Thu, 19 Oct 2006 10:42:55 GMT
Hello Javier,

just an idea.
Perhaps you can use the velocity log mechanism to get the information.
In version 1.4 (in v1.5 the API is a bit different I think) you can
write your own logging class for velocity. So there you can parse the log messages. 
It's more a dirty solution, I think. Hopefully the developers have a better idea. :-)

Ciao Matthias

-------- Original-Nachricht --------
Datum: Thu, 19 Oct 2006 11:37:43 +0200
Von: Javier Velez <>
An: Velocity Users List <>
Betreff: Which variables are involved in a template?

> Hi,
> I am developing a tool using velocity. In my application the user write 
> down a template and then it is evaluated within a velocity context. But 
> somtimes not all variables in template are found in the context. So I 
> need a mechanism to recognize which variables could not be resolved.
> One solution is evaluate once the template and then parse it looking for 
> string maching with $xxxx or ${xxxx}. My question is: Is there any other 
> more straitforward mechanism within the velocity API that give me the 
> list of unsolved variables? Or at least, is there a method in velocity 
> API that returns the list of referenced variables witin a template?
> Thanks in forward.

GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s!

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

View raw message