Hi everyone I'm trying to compare two values using struts2 s:if tag but its not working. If I hardcode the values it works but I want it to be dynamic.
The variable stringValue is of type String. The variable currentLongValue is of type Long.
<s:set var="stringValue" value="order"/>
<s:iterator value="listTest">
<s:set var="currentLongValue" value="value"/>
<s:if test="#currentLongValue.toString() == #stringValue" >
//Do something
</s:if>
<s:else>
//Do something else
</s:else>
</s:iterator>
For the s:if I have tried toString and also the equals(). It only works if I hardcode the values. Example:
<s:if test="#currentLongValue == 1234">
Any clues?
Thank you.