控制层:
model.addAttribute("blog",blog);
然后,在我的FreeMarker页面中,我必须用此对象进行判断,因此我编写以下表达式:
<#if (${blog.belongid==1 })>
red
</#if>
然后就报以下错误:
<span style="color:#cc0000">You can't use "${" here as you are already in FreeMarker-expression-mode.
Thus, instead of ${myExpression}, just write myExpression.
(${...} is only needed where otherwise static text is expected, i.e, outside FreeMarker tags and ${...}-s.)</span>
解决方法:
更改为
<#if (blog.belongid==1)>
red
</#if>
即可