I have a template in which I do:

<#if result.numFound > 10> 
  (some data)
</#if>

This gives me parse error:

For "#if" condition: Expected a boolean, but this evaluated to a number

result.numFound is Integer. I've read the documentation, maybe I'm missing something...

有帮助吗?

解决方案

You missed that last couple of lines in the documentation :).

How to test if x is greater than 1? <#if x > 1> will be wrong, as FreeMarker will 
interpret the first > as the end of the tag. Thus, either write <#if (x > 1)> or <#if x &gt; 1>.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top