Ahh. Now I get tools.... So simple :-)
Dummied the ArrayTool down to just what I need. Later it can be swapped for the real thing I guess. Herre's what I did....
//----------------------------- start snip package mystuff;
import java.lang.reflect.Array;
public class VelocityArrayTool {
/** * Default constructor. */ public VelocityArrayTool() { }
public Integer length(Object array) { int length; try { length = Array.getLength(array); } catch (Exception e) { return null; }
return new Integer(length); }
} //----------------------------- end snip
then added it to the context as you suggested.
Thanks for all the help!
,boz
On Mar 18, 2005, at 8:07 AM, Mike Kienenberger wrote:
Christofer 'boz' Jennings <[EMAIL PROTECTED]> wrote:Is there a binary for ArrayTool somewhere or do I just build it?
And how would it get configured programmatically (eg. velocity.setProperty())?
It's included with the latest (cvs) Velocity tools, I think.
It's also available on the Velocity Wiki.
http://wiki.apache.org/jakarta-velocity/ArrayTool
It's easy enough to just add it to your project as another java file (that's
what I'd do).
To use it, either configure it via toolbox.xml (if you're using that) or
just do a velocityContext.put("arrayTool", new ArrayTool());
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]