You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Majji, Sashibhushan" <SM...@carreker.com> on 2005/03/30 17:56:54 UTC
Comparing null...
Hi All,
Can we compare null condition in velocity
# if ($type != null)
#end
Thanks
Sashi
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Comparing null...
Posted by Barbara Baughman <ba...@utdallas.edu>.
Problem is, this also returns true if $type is a Boolean with value
false. I usually don't distinguish between the two and would use
this to check for nulls. If $type could be null or a Boolean, you'll
want to use something fancier than the suggestion below to
distinguish between the two.
Barbara Baughman
X2157
On Wed, 30 Mar 2005, tarun Narang wrote:
> hi shashi
>
> try this too
>
> #if(!$type)
>
> .......statements
>
> #end
>
> ----- Original Message -----
> From: "Shinobu Kawai" <sh...@gmail.com>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Wednesday, March 30, 2005 10:29 PM
> Subject: Re: Comparing null...
>
>
> > Hi Sashi,
> >
> > > Can we compare null condition in velocity
> > >
> > > # if ($type != null)
> > >
> > > #end
> >
> > Check out here for more...
> > http://wiki.apache.org/jakarta-velocity/VelocityFAQ
> >
> > Best regards,
> > -- Shinobu
> >
> > --
> > Shinobu Kawai <sh...@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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Comparing null...
Posted by tarun Narang <ta...@secf.com>.
hi shashi
try this too
#if(!$type)
.......statements
#end
----- Original Message -----
From: "Shinobu Kawai" <sh...@gmail.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, March 30, 2005 10:29 PM
Subject: Re: Comparing null...
> Hi Sashi,
>
> > Can we compare null condition in velocity
> >
> > # if ($type != null)
> >
> > #end
>
> Check out here for more...
> http://wiki.apache.org/jakarta-velocity/VelocityFAQ
>
> Best regards,
> -- Shinobu
>
> --
> Shinobu Kawai <sh...@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
Re: Comparing null...
Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Sashi,
> Can we compare null condition in velocity
>
> # if ($type != null)
>
> #end
Check out here for more...
http://wiki.apache.org/jakarta-velocity/VelocityFAQ
Best regards,
-- Shinobu
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org