velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@4quarters.com>
Subject Re: POLL: null context attribute values
Date Thu, 15 Jan 2004 22:47:33 GMT

On Jan 15, 2004, at 5:38 PM, lloyd wrote:

> Mike Kienenberger wrote:
>> The more I use Velocity, the more I find myself writing hacks to get 
>> around the inability of Velocity to handle nulls as a context 
>> attribute value.
>> Over the last half-year I've been subscribed to the mailing list, 
>> I've seen comments that suggest the current behavior can't be changed 
>> because it'd break backwards compatiblity.
>> Is there anyone on this mailing list that depends on context 
>> attributes not being set to null when the RHS evalutes to null?
>> Or are we all silently suffering because of some mythical or 
>> implausible use case that doesn't exist?
>
> i realize i'm coming to this a little late - what's the latest 
> thinking on it?
>
> i agree 100% that the null values problem is a BIG impediment to 
> writing sane templates.  i've been silent on the list for a long time 
> because velocity mostly gives me everything i need, but i'm working on 
> a template that works with a deeply hierarchical object, with a lot of 
> levels to iterate over, and *all* the elements at all levels can have 
> null values.  lots of checks for nulls and #if blocks that contribute 
> nothing but confusion...
>
> if a value is null, it should be *null*, not the previous value  :-)

Question : if #set could make LHS == null, would anything break in 
existing templates?  It's a one line fix if not... :)


-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.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