Compare two lines in freemarker

I use a free token and I return the response from the application as a string, I need to compare the response with a static some string. Here's how to do it. ${users.isValid} it returns "true", but I cannot compare this variable form my variable.Code, which I use:

 <#if ${parameters.isvalid}> 
This is valid data.
 <#else> 
This is invalid data.
 </#if> 

How can this problem be closed in advance.

+7
freemarker
source share
2 answers

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

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

+12
source share
 //if isvalid is a string variable... <#if parameters?? && parameters.isvalid?? && parameters.isvalid="true"> blah blah <#else> lah lah </#if> //if isvalid is a boolean variable... <#if parameters?? && parameters.isvalid?? && parameters.isvalid=true> blah blah <#else> lah lah </#if> 

See files :

0
source share

All Articles