$ null检查速度 [英] $null check in velocity

查看:121
本文介绍了$ null检查速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过您更新的资源在速度1.6中使用$ null来了解空检查。
资源:读取Velocity模板中映射的模型对象
但我面临如此多的挑战,因为没有提供有关此问题的文档,因此没有$ null用于null检查速度。
请向我提供说明$ null的文件,作为空检查速度的有效。

I came to know about null check using $null in velocity 1.6 through a resource updated by you. Resource: Reading model objects mapped in Velocity Templates But I am facing so many challenges that there is no $null for null check in velocity as there is no documentation provided about this. Please provide me with documentation stating $null as valid for null check in velocity.

提前付款
lucky

Thanks in Advance lucky

推荐答案

要检查变量是否为空,只需使用#if($ variable)

To check if a variable is not null simply use #if ($variable)


#if ($variable) 
 ... do stuff here if the variable is not null
#end

如果你需要做的话,如果变量为null则只是否定测试

If you need to do stuff if the variable is null simply negate the test


#if (!$variable)
 ... do stuff here if the variable is null
#end

这篇关于$ null检查速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆