rss
twitter

Wednesday, May 11, 2011

Greater than comparison in Freemarker tags

In Freemarker we can test the lesser than condition directly  .
<#if value1 < valu2>
    value1 is less than value2
 </#if>

But we can't do the same for greater than (>) in freemarker tag like

//Wrong method
<#if value1 > valu2>
    value1 is greater than value2
 </#if>

The above one is wrong because the first occurrence of  > sign will close the <#if condition. so for this we need to use either one of the following methods

 Correct Method 1:
 <#if (value1 > value2)> 
   value1 is greater than value2
 </#if>

Correct Method 2:

 <#if value1  &gt; value2>
   value1 is greater than value2
 </#if>

Bookmark and Share

2 comments:

Anonymous,  October 24, 2014 at 1:03 AM  

Your post has saved me. Thank you!

midn October 14, 2019 at 1:07 AM  

replica watches uk, combining elegant style and cutting-edge technology, a variety of styles of replica longines watches, the pointer walks between your exclusive taste style.

Post a Comment

Tech World

Label Cloud

Must Buy

  © Blogger templates by Ourblogtemplates.com updated with zenplate.com tips

Back to TOP