velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <>
Subject Re: [FAQ] How do you check for null?
Date Fri, 03 Dec 2004 22:36:30 GMT
Hi Mike,

> #if ((! $car.fuel) && ("$!car.fuel" == ""))

> Unless the template designer knows the underlying type of the java object,
> the only safe solution is to check for "(null or false) and (null or
> empty-string)" => if true, must be null.

Thanks, I didn't think of this method.  I'll add that this logic
applies because (false and empty-string and not null) is always false.
 I'll put this between Approach 2 and 3.

Note : The template designer has to be some kind of mathematician to
understand what they're doing.  ;)

Best regards,
-- Shinobu Kawai

Shinobu Kawai <>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message