Nathan Bubna wrote:
Pre-1.6 versions of Velocity always use toString() for references,
without exception.  So in a pre-1.6 situation, you pretty much have to
create a custom directive to do something like this.   With 1.6,
though, we've introduced the Renderable interface:
http://velocity.apache.org/engine/releases/velocity-1.6.2/apidocs/index.html

If a reference implements this, then the render(Context,Writer) method
is used.  So, now you can go either way, and creating an object that
uses Renderable to get at the writer is probably going to be easier
than a custom directive.

Aha!  This is exactly what I was looking for.  Thanks!

This way the template can just think it's inserting a value, but in reality a bunch of complicated stuff can hide behind the scenes. Beats the old approach, where we were using an iterator and working on it from the template.

Daniel

--
Daniel Noll                            Forensic and eDiscovery Software
Senior Developer                              The world's most advanced
Nuix                                                email data analysis
http://nuix.com/                                and eDiscovery software

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to