0

Here, I am creating a jsp where I am getting the actionId from the database. Here, I want to add the <s:if> condition tag and check for particular values.

 <td  style="font-size: 13px;font-weight: bold;" align="center" width="50px">
     <s:property value="actionId"/>
     <s:if test="#request.dtls=='1'">testing</s:if>
     <s:iterator  value="#request.dtls" status="dtl">
     <div class="form-input">
        <s:property value="actionId"/>
     </div>
     </s:iterator>
 </td>

This doesn't seem to work. Any idea where I am going wrong?

Roman C
  • 49,761
  • 33
  • 66
  • 176
struts2
  • 54
  • 1
  • 7

1 Answers1

0

The #request.dtls should be a collection.

<s:if test="#request.dtls.contains('1')">testing</s:if>
<s:iterator value="#request.dtls" status="dtl">
 <s:if test= "top == '1'">
  <div class="form-input">
   <s:property value="actionId"/>
  </div>
 </s:if>
</s:iterator>
Roman C
  • 49,761
  • 33
  • 66
  • 176