This is my code in jsp:
<s:iterator value="sources" status="sourceStatus">
<s:property value="sourcesCheck"/>
<s:property value="#sourceStatus.index"/>
<s:if test="%{sourcesCheck.contains(#sourceStatus.index)}">
true
</s:if>
<s:else>
false
</s:else>
</s:iterator>
sourcesCheck is an array I pass from my action populated with values 0,1,2,3,4,5. The results on my jsp show 0,1,2,3,4,5 for sourcesCheck, however, the test is always false. Why? I have tried with both int and String values for sourcesCheck. How does contains work? If index is not a String or int, what is it?
Use this code: