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. html 打印相关操作与实现

    2020-02-19 | chrome 79.0.3945.130 测试无问题 未做兼容测试 原理为调用 window.print() 方法,但是该方法只能对当前页面全部打印,所以有了以下方案来解决局 ...

  2. Python - 运行流程图, call graph, 调用图

    解决方案 pycallgraph(感觉直接用pycallgraph grahviz命令生成的图并不是我想要的) 如何去阅读并学习一些优秀的开源框架的源码? - mailto1587的回答 - 知乎 h ...

  3. IIS反向代理配置教程(最终完整版本)

    IIS代理配置教程 插件下载:https://download.csdn.net/download/song_yan_/11996489 一.安装反向代理插件 1.rewrite插件安装 (1) 双击 ...

  4. mysql成功的远程连接

    1.在虚拟机上的window7中安装mysql,版本mysql-5.7.27-win32,可以是解压版或者是安装版的, MySQL安装文件分为两种,一种是msi格式的,一种是zip格式的.如果是msi ...

  5. pycharm如何关闭虚拟环境(即取消venv命令行)

    venv命令行 是虚拟环境特有, 为什么要使用虚拟环境: 在实际项目开发中,我们通常会根据自己的需求去下载各种相应的框架库,如Scrapy.Beautiful Soup等,但是可能每个项目使用的框架库 ...

  6. NAT穿透的方式

    目前主要的NAT类型有如下几种: 1)Full-cone NAT, also known as one-to-one NAT 一旦一个内网地址 (iAddr:iPort) 被映射到一个外部地址 (eA ...

  7. Net Core解决ZipFile解压中文出现乱码

    一.在main方法中添加 Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); 二.解压添加 //sourceArchiveFi ...

  8. [数据库] MariaDB安装及使用

    一.安装MariaDB 1.使用官方源安装marisdb 如果使用阿里云的源,目前的版本号为5.5.64.如果想安装最新的10.x版本,则需要使用MariaDB的官方源. 1)配置官方源: 在/etc ...

  9. Python web在IIS上发布方法和原理

    Python web应用想要发布使用iis发布有两种方式,这篇文章就为大家介绍一下这两种方式的具体实现: 1.配置HttpPlatform程序 HttpPlatform 模块将套接字连接直接传递到独立 ...

  10. 洛谷P1164小A点菜(01背包)

    题目背景 uim神犇拿到了uoi的ra(镭牌)后,立刻拉着基友小A到了一家……餐馆,很低端的那种. uim指着墙上的价目表(太低级了没有菜单),说:“随便点”. 题目描述 不过uim由于买了一些辅(e ...