> contains a specific key (i.e., use the map's containsKey() method).
> Can this method be used in Velocity?
Any public methods should just work.
> I tried various syntactical
> combinations of the following...
> #if ($status.errorMessages.containsKey("foo"))
> ...but they all throw an error.
Pray tell -- what's the error? :-)
I just tried it out...works for me.
String template = "$MAP.containsKey('FOO') $MAP.containsKey('BAR')";
// Also works with $MAP.containsKey("FOO")
VelocityContext context = new VelocityContext();
HashMap mymap = new HashMap();
mymap.put("FOO", "BAR");
context.put("MAP",mymap);
StringWriter w = new StringWriter();
Velocity.evaluate(context, w, "myTemplate", template);
Cheers,
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]