I have tried to check if the List contains particular element or not using Struts 2 in <s:if> tag?
<display:table class="noheader-border" id="data" name="lstAttendance" sort="list"
uid="row" htmlId="sources" export="false">
<display:column style="width:150px">
<s:property value="%{#attr.row.worker.workerName}" />
</display:column>
<display:column style="width:10px;weight:bold;">:</display:column>
<s:if test="lstSalaryDefinedWorkerId.contains(%{#attr.row.workerId})">
...
</s:if>
...
I guess you can do it using OGNL syntax. For example I have a list and a property in my action class like:
All I need to do following in my JSP page
For details refer to the Struts 2 OGNL documentation: