1.
忽略null值
假设前提:user.name为null
${user.name},异常
${user.name!},显示空白
${user.name!'vakin'},若user.name不为空则显示本身的值,否则显示vakin
${user.name?default('vakin')},同上 --------------------------------------
${user.name???string(user.name,'vakin')},同上
2.
- date: 只显示日期,不显示时间.
如${createTime?date}
或${createTime?date('yyyy-MM-dd')}
- time: 只显示时间,不显示日期
如${createTime?time}
或${createTime?time('hh:mm:ss')}
- datetime: 时间和日期同时显示
如${createTime}
或${createTime?datetime('yyyy-MM-dd hh:mm:ss')}
或${createTime?string('yyyy-MM-dd hh:mm:ss')}--------------------