freemarker如何判断对象为空

freemarker如何判断对象为空


1、if和”??“

     <#if age??>

          无年龄值

     <#/if>


2、$和!

    ${age!'0'}

    如果age为null,默认给'0'

原文地址:https://www.cnblogs.com/hzcya1995/p/13314291.html