Mike Kienenberger wrote:

"J. B. Rainsberger" <[EMAIL PROTECTED]> wrote:

Mike Kienenberger wrote:

The more I use Velocity, the more I find myself writing hacks to get

around


the inability of Velocity to handle nulls as a context attribute value.

Maybe I'm missing a year of threads, but what's the problem? I have plenty of nullable values in my Velocity templates and everything is beautiful for me.

In its simple and most trivial form:

#set ($aValue = $methodCall_1())
#set ($aValue = $methodCall_2())

If $methodCall_2() returned null, $aValue is still set the value of $methodCall_1(), and not null as one would expect.

So if I understand correctly, #set ($value = null) is a no-op in a Velocity template. Hm. I wonder what use case led someone to implement the language that why. That would be interesting.


Thanks for the example.
--
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand


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



Reply via email to