Freemarker出现NullNumberException异常
Spring Boot项目使用了Freemarker模板引擎。
在ftl文件中使用了一些变量,但是一直出现错误,无法正常渲染页面,反复出现的报错是:
freemarker.core.NonNumericalException: For "#{...}" content: Expected a number, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
而我使用那些变量时本来就是要string类型的,报错信息却说“Expected a number”。
最后发现错误是,应该要使用 ${…},而不是 #{…}
因为这个东西搞了一下午,记下来提醒自己。
Freemarker出现NullNumberException异常的更多相关文章
- freemarker springmvc配置异常
异常信息 java.lang.IllegalAccessError: tried to access method freemarker.ext.servlet.AllHttpScopesHashMo ...
- freemarker中的null异常处理以及!与??的使用(转)
原文链接: https://blog.csdn.net/mexican_jacky/article/details/50638062 阅读数:6304 如工程包含: 在user中我们有个角色,那么我们 ...
- freeMarker(九)——程序开发指南补充知识
学习笔记,选自freeMarker中文文档,译自 Email: ddekany at users.sourceforge.net 1.变量.范围 本章介绍当模板在访问变量时发生了什么事情,还有变量是如 ...
- freeMarker(八)——程序开发指南之配置(Configuration)
学习笔记,选自freeMarker中文文档,译自 Email: ddekany at users.sourceforge.net 1.基本内容 配置(configuration)就是 freemark ...
- spring boot 异常处理(转)
spring boot在异常的处理中,默认实现了一个EmbeddedServletContainerCustomizer并定义了一个错误页面到"/error"中,在ErrorMvc ...
- MyBatisPlus代码生成 mvc项目
package com.test; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus ...
- cosbench 异常 FreeMarker template error: The following has evaluated to null or missing
问题现象: 使用Cosbench 0.4.2.c4 版本测试Ceph RGW read test失败,遇到异常如下: FreeMarker template error: The following ...
- 当freemarker中EL表达式的值为空时出现异常的解决方法
<#list pageView.list as msg> <form name="msgForm" id="msgForm" ...
- freemarker null异常详解及兼容模式
在读取user的时候,因为为空,报错了,错误处的代码是这样的 <#if user> 其实准确的写法应该是 <#if user??> 如果要消除错误,需要把前端代码修后成后面这种 ...
随机推荐
- Lerning Entity Framework 6 ------ Defining the Database Structure
There are three ways to define the database structure by Entity Framework API. They are: Attributes ...
- 201621123018《Java程序设计》第9周学习报告
1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结集合与泛型相关内容. 泛型个人认为可以理解为一种模糊的类型,在里面写入各种方法,程序员可以根据需要再创建具体类型的对象,然后调用泛型 ...
- diamond的设计思路
diamond主要包含四个包:diamond-client.diamond-sdk.diamond-server和diamond-util client就非常简单的进行http的调用server拿数据 ...
- ubuntu下nodejs源码安装
1.从github选择下载自己要安装的nodejs版本,https://github.com/nodejs/node/releases,我下载的版本是node-9.11.2.tar.gz 2.解压no ...
- GoLang学习控制语句之字符串
Go语言字符串是一种值类型,且值不可变,即创建某个文本后你无法再次修改这个文本的内容:更深入地讲,字符串是字节的定长数组.Go 代码使用 UTF-8 编码(且不能带 BOM),同时标识符支持 Unic ...
- sync.Pool 资源池
sync.Pool type Pool struct { // 可选参数New指定一个函数在Get方法可能返回nil时来生成一个值 // 该参数不能在调用Get方法时被修改 New func() in ...
- MATLAB 到 Python之路1_数据结构和简单操作
在numpy中,用array来代替matrix,不同于MATLAB中的万物皆matrix,这里的数据首先以array存在,然后通过操作才能和矩阵形式的array运算 1,array的形式 1.1 一维 ...
- Android 开发工具类 35_PatchUtils
增量更新工具类[https://github.com/cundong/SmartAppUpdates] import java.io.File; import android.app.Activity ...
- Chapter 2 Open Book——26
"Oh." He let it drop. I looked away awkwardly. 哦,他让它走了.我笨拙的看向别处. “哦.”他不再纠缠于这个问题.我笨拙地移开视线. ...
- mysql 删除单表内多个字段重复的数据
mysql 删除单表内多个字段重复的数据 DELETE from lot_log_payflow WHERE (pay_no,sub_flow_type) in () s1) AND id ) s2) ...