freemarker if 判断是否为空

技术 置顶 精帖
0 1,182
peng49
peng49 2020-08-14 11:58:28
 

1.判断对象不为空

  1. <#if user??>
  2. </#if>

判断对象属性不为空

  1. <#if (user.name)??>//判断对象属性不为空
  2. </#if>

2、判断List是不为空

  1. <#if users?? && (users?size > 0) >
  2. </#if>
回帖
登录
忘记密码?