在使用freemarker过程中:
报错:
Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> userInfo.planName [in template "admin/paper/excellent/listData.ftl" at line 11, column 18]
翻译:
由:freemarker.core.InvalidReferenceException:以下已评估为空或丢失:
解决办法:
处理传的值为空的问题
原因:可能对象userInfo为空,也可能是planName为空
一、<td>${userInfo.planName!""}</td>
二、<td>${(userInfo.planName)!' '}</td>
user或者name为null,都显示为空。判断为空
如果为空,就以默认值(“!”后的字符)显示。