I have below velocity template construct
#if($no_of_entries > 1)
<strong>Its True !!</strong>
#else
<strong>Its False !!</strong>
#end
Even when $no_of_entries
is greater than 1 , say 10 , it prints Its False !!
That means $no_of_entries > 1
is not working
Why the $no_of_entries > 1
condition returning false ?
I tried printing the value for $no_of_entries
and it prints correct value which is > 1
EDIT :
I also tried using below code
#if( Integer.parseInt($no_of_entries) > 1)
<strong>Its True !!</strong>
#else
<strong>Its False !!</strong>
#end
But it is not working and throwing below exception -
org.apache.velocity.exception.ParseErrorException: Encountered "Integer" at file.vm
Was expecting one of:
"[" ...
"{" ...
"(" ...
<WHITESPACE> ...
<STRING_LITERAL> ...
"true" ...
"false" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<IDENTIFIER> ...
"{" ...
<WHITESPACE> ...