ex3v
ex3v

Reputation: 3566

FreeMarker: Expected a boolean, but this evaluated to a number

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

Upvotes: 14

Views: 10978

Answers (1)

Miichi
Miichi

Reputation: 1799

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

Upvotes: 19

Related Questions