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. Python字符串排序

    看了西红柿的博客,此文纯搬运,方便自己查询用. 原文:https://www.cnblogs.com/tomato0906/articles/4890701.html 1.python中的字符串类型是 ...

  2. Apache和Nginx配置默认访问index.php

    Apache: .htaccess文件配置 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d R ...

  3. java.lang.String和java.util.NClob互相转换

    //NClob或Clob转String类型 public String clob2Str(NClob nclob) throws Exception { String content = " ...

  4. 安装ubuntu18.04.3全过程

    目录 一.安装ubuntu18.04.3操作系统 二.系统设置 三.非开发常用软件安装 四.开发常用软件安装 五.ubuntu相关知识 六.参考文章链接 正文 一.安装ubuntu18.04.3操作系 ...

  5. 开放应用模型操作指南(一)| 云服务一键接入 OAM 体系

    作者 | 邓洪超  阿里云容器平台软件工程师 导读:Open Application Model(OAM)是阿里云联合微软等国际顶级技术团队联合发布的开放应用模型技术.旨在通过全新的应用定义.运维.分 ...

  6. Python - int()

    参考 https://docs.python.org/3/library/functions.html?highlight=int#int If x is not a number or if bas ...

  7. Bugku-CTF社工篇之信息查找

  8. 【代码学习】PYTHON 文件I/O

    一.文件的打开和关闭 open(文件名,访问模式) cloese() 模式 描述 r 以只读方式打开文件.文件的指针将会放在文件的开头.这是默认模式. rb 以二进制格式打开一个文件用于只读.文件指针 ...

  9. 吴裕雄--天生自然TensorFlow2教程:反向传播算法

  10. 获取天气预报java代码

    import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; imp ...