velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Yartsev" <ani...@gmail.com>
Subject Re: Velocity evaluation with null
Date Thu, 03 Jan 2008 22:05:36 GMT
You could do something like (might be ugly but it would work)

#if($myObject.getSomethingThatMightBeNull() == null)
        ##output your empty string here
#else
        $myObject.getSomethingThatMightBeNull()
#end

2008/1/3, csanders <csanders@hoovers.com>:
>
> Currently when something evaluates to null it just shows the literal
> text, like $myObject.getSomethingThatMightBeNull() .
>
> Is there to tell velocity to spit out an empty string instead of leaving
> it in the HTML ?
>
> Thanks,
> Charlie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message