Use the silent notation.

$!user.name.middleName

Good luck with Velocity.  Let us know if you've more q's.

WILL

----- Original Message ----- From: "Bayarsaikhan VOLODYA" <[EMAIL PROTECTED]>
To: "Velocity Users List" <[email protected]>
Sent: Friday, July 15, 2005 7:28 AM
Subject: Null Value?


Hi all.

my .vm file is here;

#foreach( $user in $users )
<b>Middle Name:</b> $user.name.middleName<br> #end

it outputs the something like this.
Middle Name: MyMiddleName
Middle Name: $user.name.middleName
Middle Name: test Name

since the second user.name <http://user.name> object has no value. null value. how to set velocity not to output $user.name.middleName. i want it just output nothing if property is null.

thanks a lot.


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

Reply via email to