I am using JETT's if tag to format an Excel file.
I want to use the below condition to compare a string.
<jt:if test="${thisVar == "this is an apple" }">I have an apple.</jt:if>
However, my Excel sheet keeps running into a TagParseException
where "this is an apple" is an unrecognised attribute.
Is it possible to compare strings in a JETT if tag?
You need to either escape the double quotes or use single quotes to define your String constant.
These examples work: single quotes for the String
Or escape the double quotes:
Reference:
JETT supports escaping literal double-quote characters with a backslash, and escaping backslash characters as well:
And for full reference the stacktrace you get on this error: