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.
Equals character: = (Supported since FreeMarker 2.3. 28.) The Code after the \x is 1 to 4 hexadecimal digits. For example this all put a copyright sign into the string: "\xA9 1999-2001" , "\x0A9 1999-2001" , "\x00A9 1999-2001" .
eval. This built-in evaluates a string as an FTL expression. For example "1+2"? eval returns the number 3. (To render a template that's stored in a string, use the interpret built-in instead.)
c (when used with numerical value) This built-in converts a number to string for a "computer language" as opposed to for human audience. That is, it formats with the rules that programming languages used to use, which is independent of all the locale and number format settings of FreeMarker.
The has_content FunctionFreeMarker has built-in functions to detect for variables. The most common method of detecting for empty or null values uses the has_content function and the trim function. The has_content function is often used with another built-in FreeMarker function to detect for null values.
I have used the following syntax to compare two string values in freemarker.
<#if parameters.isvalid == "true">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With