velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: null in velocity
Date Thu, 02 Dec 2004 20:04:39 GMT
I find #if( "$!car" == "" ) to be the most reliable null test.

On Thu, 2 Dec 2004 14:47:29 -0500, Terry Steichen <terry@net-frame.com> wrote:
> I think you can also do something like this:
> 
> #if($car && $car == "")
> 
> That is, if $car is defined and has no value (ie, null)
> 
> 
>   ----- Original Message -----
>   From: Shinobu Kawai
>   To: Velocity Users List
>   Sent: Thursday, December 02, 2004 10:56 AM
>   Subject: Re: null in velocity
> 
>   Hi SUBBIAH,
> 
>   > How to check for null in velocity
>   > for eg. I load a class in the context Class:: car
>   >
>   > #if ($car.getFuel() = null ?? )
> 
>   You can use NullTool
>     http://wiki.apache.org/jakarta-velocity/NullTool
> 
>   #if ($null.isNull($car.fuel))
> 
>   Best regards,
>   -- Shinobu Kawai
> 
>   --
>   Shinobu Kawai <shinobu.kawai@gmail.com>
> 
>   ---------------------------------------------------------------------
>   To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>   For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
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