FreeMarker: Boolean expected, but it is evaluated by a number

I have a template in which I am doing:

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

This gives me a parsing error:

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

result.numFound - Integer . I read the documentation , maybe I missed something ...

+6
source share
1 answer

You skipped this 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>. 
+7
source

All Articles