You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Peter Harrison <pe...@nothingbutnet.co.nz> on 2004/09/13 03:36:57 UTC

Setting Null

I've been looking through the archives, and it seems that there is a roadmap 
to have the ability to have set( $boo=null ) in 1.6. This roadmap was in the 
developers list in January this year. The roadmap had 1.4 being released 
ASAP, and 1.5 not far behind. Thing is that 1.4 was released in April, and we 
havn't seen 1.5 yet.

We are very keen to see this new feature since this issue almost lost us a 
major customer when statements printed ended up being sent to the wrong 
people - rather than having no address printed (address was null in some 
records) it used the previously set address. The developer responsible knew 
of the issue in Velocity, but just missed this consequence in this particular 
code. Its just not failsafe, and while I'm a supporter of Velocity this 
single issue continues to be a problem for us even though we are experiencd 
in using it.

Regards,
Peter Harrison

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Setting Null

Posted by Simon Christian <si...@stoutstick.com>.
I will often use #set( $boo = false ) in it's place, which if you're 
testing for the existence of the object ( #if( $boo )...#end ) works fine.

- simon

Shinobu Kawai wrote:

> Hi Peter,
> 
> 
>>I've been looking through the archives, and it seems that there is a roadmap
>>to have the ability to have set( $boo=null ) in 1.6. This roadmap was in the
>>developers list in January this year. The roadmap had 1.4 being released
>>ASAP, and 1.5 not far behind. Thing is that 1.4 was released in April, and we
>>havn't seen 1.5 yet.
>>
>>We are very keen to see this new feature since this issue almost lost us a
>>major customer when statements printed ended up being sent to the wrong
>>people - rather than having no address printed (address was null in some
>>records) it used the previously set address. The developer responsible knew
>>of the issue in Velocity, but just missed this consequence in this particular
>>code. Its just not failsafe, and while I'm a supporter of Velocity this
>>single issue continues to be a problem for us even though we are experiencd
>>in using it.
> 
> So how are you handling it right now?
> I can only think of making a tool that invokes Context#remove(String),
> something like
>   public void setNull(Context context, String key) {
>       context.remove(key);
>   }
> 
> Or an ugly
>   #set ($null = $ctx.remove("foo"))
> 
> Best regards,
> -- Shinobu Kawai
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Setting Null

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Peter,

> I've been looking through the archives, and it seems that there is a roadmap
> to have the ability to have set( $boo=null ) in 1.6. This roadmap was in the
> developers list in January this year. The roadmap had 1.4 being released
> ASAP, and 1.5 not far behind. Thing is that 1.4 was released in April, and we
> havn't seen 1.5 yet.
> 
> We are very keen to see this new feature since this issue almost lost us a
> major customer when statements printed ended up being sent to the wrong
> people - rather than having no address printed (address was null in some
> records) it used the previously set address. The developer responsible knew
> of the issue in Velocity, but just missed this consequence in this particular
> code. Its just not failsafe, and while I'm a supporter of Velocity this
> single issue continues to be a problem for us even though we are experiencd
> in using it.
So how are you handling it right now?
I can only think of making a tool that invokes Context#remove(String),
something like
  public void setNull(Context context, String key) {
      context.remove(key);
  }

Or an ugly
  #set ($null = $ctx.remove("foo"))

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