Hi Mike, > However, with the hundreds of null-based questions on the Velocity user > list, it'd sure be nice to say the following to a new user. > > "Yes, Velocity doesn't work like that, but the NullTool can provide most of > the functionality you need." I agree.
> Another thing I'd like to see is a "$nulltool.set(key, value)" method to > replace #set which can take a null value and handle it properly so one does > not have to do everything with a #set_null_ok() macro that looks like the > following (syntax untested) > > #macro set_null_ok(key value)#if > ($nulltool.isNull)$nulltool.setNull(key)#else#set($key = $value)#end#end Okay, I'll add that feature. > I'd also add the ability to return null. > > $nulltool.getNull() or $nulltool.NULL (is it legal to return a public field > or only methods?) Only methods, AFAIK. Actually, NullTool already returns null in those cases, since Velocity with return a non-defined reference as null. ;) > > I'll even make a ViewNullTool, if you like. ;-) > > I'm probably just misinterpreting a joke, but what would a ViewNullTool be? > > Maybe it has something to do with not having to specify the context. > That's the one downside I see with NullTool. I don't generally have access > to the context from the context, so I can't actually use any set method. I > haven't worked enough with the code to determine how you'd get the context > without being passed it, but I suspect it could be part of the initalization > code. Yes, that's Exactlywatt I meant. Something like ViewRenderTool. Best regards, -- Shinobu Kawai -- Shinobu Kawai <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
