FreeMarker template error:
The following has evaluated to null or missing:
==> product  [in template "product.html" at line 751, column 43]

FreeMarker模板误差:
以下已评估为null或丢失:
=产品“模板”产品HTML“在第751行,第43栏]

----------------------------

意思是有个值为null,就是不存在,

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</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??

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</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??
-----------------
提示:如果没有表达是合法的空/失踪,或者指定一个默认值myoptionalvar!mydefault,或使用< #如果myoptionalvar??>在< #别的>当失踪/ # <<如果>>。(这些仅覆盖的表达;最后一步覆盖整个表达式,使用parenthessis:(myoptionvar。Foo)!mydefault,(myoptionvar。Foo)??
 
大概意思是应该进行判断,对象是否为空

一般出现这种异常的原因为:如果对象为空,则freemarker就会抛出这个异常。

其实解决很简单,在用对象之前先判空,不空在进行属性的获取操作即可

原文地址

freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]的更多相关文章

  1. freemarker.core.InvalidReferenceException: Expression stackObject.value.get(propertyName).toString() is undefined

    很奇怪的报错, 在实体中添加 toString方法后, 想在前台列表中使用 <s:debug标签调试, 发现报错如下: freemarker.core.InvalidReferenceExcep ...

  2. freemarker.core.InvalidReferenceException

    1.错误描述 freemarker.core.InvalidReferenceException:on line 68,column 18 in ftl/inc/incPro.ftl p.mainSe ...

  3. 异常-----freemarker.core.InvalidReferenceException问题解决

    案例一 1.1.错误描述 五月 28, 2014 9:56:48 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template ...

  4. 解决 HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException:

    HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException: The foll ...

  5. CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法

    CAS (10) -- JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法 jboss版本: jb ...

  6. freemarker.core.ParseException:Unexpected end of file reached

    1.错误原因 freemarker.core.ParseException:Unexpected end of file reached 2.错误原因 由于在宏定义中,运用组件时没有关闭标签,导致出错 ...

  7. 异常-----freemarker.template.TemplateException: Expected collection or sequence. datas evaluated instead to freemarker.core.HashLiteral$SequenceHash on line 7, column 18 in inc/select.ftl.

    1.错误描述 六月 26, 2014 11:26:27 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  8. 异常-----freemarker.core.ParseException: Encountered

    1.错误描述 freemarker.core.ParseException: Encountered " " at line 14, column 12 in myself.ftl ...

  9. 异常-----freemarker.core.ParseException: Unexpected end of file reached

    freemarker自定义标签 1.错误描述 freemarker.core.ParseException: Unexpected end of file reached. at freemarker ...

随机推荐

  1. 实现在vue中element-ui的el-dialog弹框拖拽

    参考:实现在vue中element-ui的el-dialog弹框拖拽 1.在 utils 中新建 directives.js 文件 import Vue from 'vue' // v-dialogD ...

  2. html5异步单图片多图片上传两种实现方式 后台.net mvc接收

    Asp.net mvc上传多张图片后台存储 前台页面通过<file name="img">标签数组上传图片,后台根据Request.Files["img&qu ...

  3. ASCII码排序 题解

    1. while(scanf("%c%c%c%*c",&a,&b,&c)!=EOF) 这里需要注意  输入多组语句 while后面不能加分号: 2.%*c& ...

  4. SQL Server 作业的备份

    轉發:https://www.cnblogs.com/Amaranthus/archive/2012/06/25/2561569.html 作业备份,不是备份数据库,是备份作业. DECLARE @j ...

  5. 从头学pytorch(五) 多层感知机及其实现

    多层感知机 上图所示的多层感知机中,输入和输出个数分别为4和3,中间的隐藏层中包含了5个隐藏单元(hidden unit).由于输入层不涉及计算,图3.3中的多层感知机的层数为2.由图3.3可见,隐藏 ...

  6. 工具 - 正则Cheat sheet

  7. 网络基础:ARP 协议、IP协议、路由协议 均属于网络层协议

    ARP协议 ARP--地址解析协议(Address Resolution Protocol),实现通过 对方的IP地址(域名) 寻找对方的 MAC地址 ARP的功能 本地电脑查看 IP 和 MAC 对 ...

  8. python opencv:使用滑动条做调色板

    cv2.getTrackbarPos() 函数的 一个参数是滑动条的名字, 第二个参数是滑动条被放置窗口的名字, 第三个参数是滑动条的默认位置. 第四个参数是滑动条的最大值, 第五个函数是回调函数,每 ...

  9. ubuntu 18 python3.6更换国内源和pip3源

    1.更换国内源 查看Ubuntu18版本和codename(一定要注意codename对应) lsb_release -a No LSB modules are available. Distribu ...

  10. 201771010135杨蓉庆《面向对象程序设计(java)》第二周学习总结

    第一部分:理论知识学习部分 3.1 标识符:由字母.下划线.美元符号和数字组成, 且第一个符号不能为数字,可用作:类名.变量名.方法名.数组名.文件名等.有Hello.$1234.程序名.www_12 ...