velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Which variables are involved in a template?
Date Thu, 19 Oct 2006 13:24:46 GMT
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 <hendler2@gmx.de> 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 <jvelez@lsi.uned.es>
> 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: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message