FreeMarker Error : left-hand operand: Expected a hash, but this evaluated to a sequence
来源:互联网 发布:喝酒的好处知乎 编辑:程序博客网 时间:2024/06/05 18:22
FreeMarker Error : left-hand operand: Expected a hash, but this evaluated to a sequence
Ask Question
up vote2down votefavorite
When I loop through a list in freemarker like below, it works fine.
<#list cModel.products as product>
But when I'm tring to assign the size of the list to a variable like,
<#assign totalProducts = cModel.products.getList()?size>
I'm getting an exception from free marker like below
left-hand operand: Expected a hash, but this evaluated to a sequence
Any suggestions?
freemarker
add a comment
1 Answer
activeoldestvotes
up vote5down vote
I Hope you've accessing it wrongly.
As per your example, the list name is product. So,
<#assign totalProducts = cModel.getProducts()?size>
Should return back the size of the products.
Hope it helps.
Thanks for your reply. It resolved the issue. – javaAnto Jul 27 '14 at 13:25
1 cModel.products?size
is the nicer way of doing that. – ddekany Jul 27 '14 at 13:57 0 0
- FreeMarker Error : left-hand operand: Expected a hash, but this evaluated to a sequence
- error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::wstring'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::wstring'
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class Stude
- error:include/asm is a directory but symlink was expected
- expected number,sequence,or string.map evaluated instead of freemarker.template.smplehash
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion
- 错误1error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::str
- freemarker.template.TemplateException: Expected string. column.nullable evaluated instead to freemar
- MyBatis:The expression 'list' evaluated to a null value
- [ERROR] The goal you specified requires a project to execute but there is no POM in this directory
- [ERROR] The goal you specified requires a project to execute but there is no POM in this directory
- the left operand of ** is a garbage value
- the left operand of ** is a garbage value
- caffe之均值文件
- 同步类容器和并发类容器的应用
- 爬虫框架Scrapy之Item Pipeline
- 在Java中使用Date的一些提示
- ELF文件结构详解
- FreeMarker Error : left-hand operand: Expected a hash, but this evaluated to a sequence
- python单元测试常用方法
- JQ笔记(jquery + ajax 入门)
- 论文总结(二)—图像复原
- PAT A除以B
- Unity3D笔记(一)基础知识学习笔记
- codeforces 782B The Meeting Place Cannot Be Changed
- 使用matlab实现简单的遗传算法(一)
- 【LeetCode】54. Spiral Matrix
Product.getList()
? Post the Java. – Raedwald Jul 27 '14 at 7:43