freemarker如何判断对象为空

freemarker如何判断对象为空

 

1、if和”??“

     <#if age??>

          无年龄值

     <#/if>

 

2、$和!

    ${age!'0'}

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

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自www.cnblogs.com/odejsjhshw/p/10374807.html