${productInfo.productIcon}无法定义

来源:10-3 实现商品列表

car

2017-11-17

${productInfo.productIcon}这句出错,抛出错误

FTL stack trace ("~" means nesting-related):

- Failed at: ${productInfo.productIcon}  [in template "product/list.ftl" at line 36, column 69]

----

at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)

at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:465)

at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:387)

at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:356)

at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96)

at freemarker.core.DollarVariable.accept(DollarVariable.java:59)

at freemarker.core.Environment.visit(Environment.java:362)

at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:315)

at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)

at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:242)

at freemarker.core.Environment.visitIteratorBlock(Environment.java:595)

at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:107)

at freemarker.core.IteratorBlock.accept(IteratorBlock.java:93)

at freemarker.core.Environment.visit(Environment.java:326)

at freemarker.core.Environment.visit(Environment.java:332)

at freemarker.core.Environment.process(Environment.java:305)

at freemarker.template.Template.process(Template.java:378)


写回答

1回答

廖师兄

2017-11-18

这个是和java里定义的对象相对应的,检查下自己定义的对象。还找不出问题,就对比下源码。

0
3
car
非常感谢!
2017-11-18
共3条回复

Spring Boot双版本(1.5/2.1) 打造企业级微信点餐系统

从0到1开发中小型企业级Java应用,并学会迭代重构技巧

6410 学习 · 5247 问题

查看课程