freemarkers skip assertNonNull InvalidReferenceException

蹲街弑〆低调 提交于 2019-12-02 03:48:30

You should check in the template if the value is missing, and then print something that makes sense for the recipients ("null" certainly doesn't make sense for them). Like, N/A if the item needs no value:

<li><b>${item.key}</b> : ${item.value!'N/A'}</li>

or skip the whole line if the value is missing because the record is still incomplete:

<#if item.value??>
  <li><b>${item.key}</b> : ${item.value}</li>
</#if>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!