use jstl:

<logic:iterate id="people" name="employees" indexId="index">
        <c:if test="${index%2==0}">
        <tr class='Even'>
        </c:if>
        <c:if test="${index%2==1}">
        <tr class='Odd'>
        </c:if>
...
</logic:iterate>

Of course you can use a c:choose if you like and several other options but
thats just a start.
-Tim

-----Original Message-----
From: Charles Liu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 12:00 PM
To: [EMAIL PROTECTED]
Subject: <logic:iterate> index question


Hi,
What is the best way to test the value of indexId?
For example,
<logic:iterate id="people" name="employees" indexId="index">
<tr class='<%=index.intValue()%2==0?"Even":"Odd"%>'>
...
</logic:iterate>
This works but it depends on the fact that index has type of Integer. Is 
there a better way to do the same kind of testing but hide the 
implementation detail?

Thanks

-- 
Charles Liu



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to