Hello,

 I've been combing the velocity docs/faqs and haven't found an answer to the
following:  How do I get nulls into context variables?  For example, in some
.vm file I would want to do:

#set ( $foo = $bar.someBigExpensiveOperationThatMayReturnNull(..) )
#if ( $foo )
   ...
#end

But _don't_ want to do:

#if ( $bar.someBigExpensiveOperationThatMayReturnNull(..) )
   #set ( $foo = $bar.someBigExpensiveOperationThatMayReturnNull(..) )

  The problem is $foo won't be set to "null" if velocity sees a null and
even worse, the prior value will be used.  I've noticed that the Context
class extends from Hashmap which does not allow nulls but this seems like an
oversight? IMHO of course :)

  My situation is further worsened since I'm mainly working in Texen/Anakia
which limits code objects i can place in the context to use as "helpers"
that aid in this functionality.

  Any insights would be greatly appreciated?

russ


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to