freemarker 异常 student.age does not evaluate to true/false
2013-08-06 21:08
267 查看
在生成html文件时报的异常:
freemarker.core.NonBooleanException: Error on line 21, column 22 in hello.ftl Expecting a boolean (true/false) expression here Expression student.age does not evaluate to true/false
ftl文件的代码:
<#if student.age>18>
好家伙, ${student.age} 成年啦
</#if>
------------解决方法有两个:
方法一: 把<#if student.age>18> 改为<#if 18<student.age> 貌似是把大于号当做标签的">"来看了
方法二: <#if student.age>18>中间的条件用小括号括起来,只要保证小括号里面返回true/false就行(其他的多条件判断也可以用) --------------这个很保险!
相关文章推荐
- spring 管理事务配置时,结果 报错: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here这个异常
- error C2064: term does not evaluate to a function
- LINQ to SQL 异常:SQL Server does not handle comparison of NText, Text, Xml, or Image data types
- 关于According to TLD or attribute directive in tag file, attribute value does not accept any expressions异常
- .size expression for apf_page_fault does not evaluate to a constant
- Linux网卡异常:解决Device eth0 does not seem to be present
- jboss服务器 JAVA_HOME does not point to the JDK 异常处理
- Certificates does not conform to algorithm constraints 异常的解决方法
- 类成员指针 error C2064: term does not evaluate to a function
- VC6.0: error C2064: term does not evaluate to a function
- Scrapped or attached views may not be recycled. isScrap:false isAttached:true异常
- C2064: term does not evaluate to a function解决方法
- size expression for do_hypervisor_callback does not evaluate to a constant
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions异常原因及解决方法
- 三大框架整合异常之No Hibernate Session bound to thread, and configuration does not allow creation of non-tran
- 【magento2命令行安装 WINDOWS】Composer异常: Your configuration does not allow connection to xx.,
- Variable has existed/does not exist ,Did you mean to set reuse=True/None?
- hive 异常 (Attempt to do update or delete on table terminal that does not use an )
- size expression for do_hypervisor_callback does not evaluate to a constant
- VC中出现error C2064: term does not evaluate to a function