velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manish" <prol...@gmx.net>
Subject Re: Compare null
Date Wed, 06 Oct 2004 08:23:32 GMT
Ah thanks!
This should work, but there a global macro somewhere in my code that
replaces all these blank "" for nulls by NA value.
Now I'll have to figure out whether this test comes first or it is the
macro. Someone else wrote this code and he's leaving....
It's fun being a programmer, excitement never stops!!!!! ;)

- Manish

p.s.
Nathan,
Are you one of the original developers of Velocity? I find your replies
quite useful and thorough.


----- Original Message -----
From: "Nathan Bubna" <nathan@esha.com>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Wednesday, October 06, 2004 12:43 PM
Subject: Re: Compare null


> Manish said:
> > How can I compare 'null' in my velocity template for if condition???
> > The following results in an error.
> >
> > #if(null == $p.getDisplayaddressbool()){
> > }
>
> you're confusing java with VTL.  VTL has no null keyword or token. (though
it
> was discussed favorably in ages long past.)
>
> i've found the most reliable way to test for nulls is:
>
> #if( "$!myboolean" == "" ) foo is null! #end
>
> Nathan Bubna
> nathan@esha.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