freemarker报错:Tip: If the failing expression is known to be legally null/missing, either specify a de

freemarker报错:Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??



大致意思是所写的表达式应判定不为空或者指定一个默认值,貌似ftl的<#if>判断一般都一定要判断一下不能为空

错误写法(后台会报错,实际上可以允许):

<#if lists?? && lists?size gt 0>
<#list lists as list>


纠正写法:

<#if lists?? && lists?size gt 0>
<#list lists as list>




你可能感兴趣的:(html,FreeMarker)