Date: 2004-12-06T21:03:46
Editor: ShinobuKawai <[EMAIL PROTECTED]>
Wiki: Jakarta-Velocity Wiki
Page: VelocityFAQ
URL: http://wiki.apache.org/jakarta-velocity/VelocityFAQ
Add custom directive approach to null FAQ. Thanks to Henning for the idea.
Change Log:
------------------------------------------------------------------------------
@@ -74,6 +74,17 @@
// return true if fuel is empty.
}
}}}
+
+''Approach 6:'' Use a custom directive.
+cf. IfNullDirective, IfNotNullDirective
+{{{
+#ifnull( $car.fuel )
+}}}
+ ''Note:'' You will have to register the directive in your
velocity.properties.
+{{{
+userdirective = org.apache.velocity.tools.generic.directive.Ifnull
+userdirective = org.apache.velocity.tools.generic.directive.Ifnotnull
+}}}
[[BR]]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]