简体   繁体   English

Apache Velocity IfNotNull

[英]Apache Velocity IfNotNull

This link describes how to use if not null condition in velocity. 此链接描述了如何在速度中使用if not null条件。

userdirective = org.apache.velocity.tools.generic.directive.Ifnull
userdirective = org.apache.velocity.tools.generic.directive.Ifnotnull

But looking inside velocity tools jar there is no such class org.apache.velocity.tools.generic.directive.Ifnotnull . 但是,在速度工具罐中查看时,没有此类org.apache.velocity.tools.generic.directive.Ifnotnull

What am I missing here? 我在这里想念什么?

From your link: 从您的链接:

Use a custom directive. 使用自定义指令。 cf. 比照 IfNullDirective, IfNotNullDirective IfNullDirective,IfNotNullDirective

You have to put the linked code ( http://wiki.apache.org/velocity/IfNullDirective and http://wiki.apache.org/velocity/IfNotNullDirective ) in your sources, it's not provided in the regular velocity jar. 您必须在源中放入链接的代码( http://wiki.apache.org/velocity/IfNullDirectivehttp://wiki.apache.org/velocity/IfNotNullDirective ),常规速度罐中未提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM