hi otto,
that solution didnt work - it wouldn't recognise bar as a variable in the <%= %>.
this solution does work for me:
<bean:size id="size" name="articles" scope="session" />
...
<logic:iterate id="article" name="articles" scope="session" indexId="index" >
...
<logic:equal value="<%= String.valueOf(size.intValue()-1) %>" name="index">
...
</logic:equal>
...
</logic:iterate>
the value parameter must be a string, so i used the String.valueOf method.
however this isnt very clean - are there better solutions?
Ben
-----Original Message-----
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: vrijdag, februari 06, 2004 10:46
To: 'Struts Users Mailing List'
Subject: AW: logic:iterate question
Sorry, I mean:
"foo.length-1" instead "bar.length-1"
-----Urspr�ngliche Nachricht-----
Von: Otto, Frank [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 6. Februar 2004 10:41
An: 'Struts Users Mailing List'
Betreff: AW: logic:iterate question
Hello Ben,
you can do this in this way:
<logic:iterate id="foo" name="bar" scope="session" indexId="index">
...
<logic:equal value="<%=bar.length-1%>" name="index">
...
</logic:equal>
</logic:iterate>
Regards,
Frank
-----Urspr�ngliche Nachricht-----
Von: Turner Benjamin [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 6. Februar 2004 09:08
An: [EMAIL PROTECTED]
Betreff: logic:iterate question
hello,
i have a question about the <logic:iterate> tag. My tag iterates over an ArrayList
which contains an amount of beans. However, in the last iteration i want to perform
some special action. My current code looks something like this:
<logic:iterate id="foo" name="bar" scope="session" indexId="index">
...
<logic:equal value="..." name="index">
...
</logic:equal>
</logic:iterate>
However, i have no idea what to fill in in the dots (should be something like
"bar.length-1"), or whether this kind of construction is even supposed to work. As far
as i can make up out of the docs, logic:equal is only for constant comparison.
any hints on how to do this?
ty,
Ben
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]