Compare two strings in freemarker

venkat2010 picture venkat2010 · Dec 17, 2013 · Viewed 39.3k times · Source

I am using free marker and i am returning response from application as string i need to compare the response with static some string . Here is the way of doing. ${users.isValid} it is returning "true" in but i am not able to compare this variable form my variable.Code i am using is :

<#if ${parameters.isvalid}>
It is valid data
<#else>
It is Invalid data
</#if>

What is possible way to close this issue thanks in advance.

Answer

venkat2010 picture venkat2010 · Dec 19, 2013

I have used the following syntax to compare two string values in freemarker.

<#if parameters.isvalid == "true">