0

I have the following code:

    <logic:iterate id="paymean" name="JstSelectPaymentInfoForm" property="barsOption.list" collection= indexId="barInd" type="com.amdocs.css.jst.singleorder.checkout.view.JstPaymentInfoBar">

        <%
            if(barInd!=sizeOftheList-1)){
                          .
                          . 
                          .
            }
        %>

I want that instead of sizeOftheList, I'll have an expression that will give me the size of the list that I am iterating over. I am using JSP scriptlets and struts

Roman C
  • 49,761
  • 33
  • 66
  • 176
Peter Nijem
  • 3,625
  • 2
  • 12
  • 7

1 Answers1

-1

First, never use scriplets in your JSP pages.

How to avoid Java code in JSP files?

Second, try this -

<c:set var="count" value="0" scope="page" />      
<logic:iterate id="paymean" name="JstSelectPaymentInfoForm" property="barsOption.list" collection= indexId="barInd" type="com.amdocs.css.jst.singleorder.checkout.view.JstPaymentInfoBar">
  <c:set var="count" value="${count + 1}" scope="page"/>
</logic:iterate>
//see the value of the count variable 
${count}
Community
  • 1
  • 1
Maverick
  • 302
  • 1
  • 5
  • 17