The latest version of Velocity (1.5) has an event handler
"InvalidReferenceEventHandler" that allows you to capture bad
references.  It's not yet documented but you can read the docs on
event handlers, then look at the javadocs for this specific one.

It's available in svn, we'll do a beta release soon.

WILL

On 10/19/06, Matthias Hendler <[EMAIL PROTECTED]> wrote:
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 <[EMAIL PROTECTED]>
An: Velocity Users List <velocity-user@jakarta.apache.org>
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! http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to