Question

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...

Was it helpful?

Solution

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>.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top