Search code examples
struts2jsp-tags

String functions on static strings inside <s:if value = ""> - struts2


I am trying to migrate to Struts 2 and I have the following if scriplet that I have to change to

<logic:iterate id="grpItem" collection="<%= impGroupTypeList %>">
    <% if (grpItem.getImpGrpTypCd().trim().equals(impUploadType.trim())){%> 

Solution

  • <s:iterator var="grpItem" value="%{#session.impGroupTypeList}">
                                            <s:if
                                                test='impGrpTypCd.trim().equals(#session.impUploadType.trim())'>
                                                </s:if>