Hi all,
I want to create a list with 2 lines like what follows:
hemistich1 hemistich2
hemistich3 hemistich4
hemistich5 hemistich6
... ...
.
.
There's an Array of Strings containing content of the list
["hemistich1", "hemistich2", .....]
I can't make 2 new Arrays out of the first one.
I want to implement what intended using <logic:iterate> over the Array, any idea to do so? (Array content will be made dynamically)
Thanks any way
Majid Makki
Discussions
Web tier: servlets, JSP, Web frameworks: Struts: Iterating over an Array but creating a list with 2 lines
-
Struts: Iterating over an Array but creating a list with 2 lines (1 messages)
- Posted by: Majid Makki
- Posted on: August 14 2004 07:41 EDT
Threaded Messages (1)
- Struts: Iterating over an Array but creating a list with 2 lines by Rene Zanner on August 16 2004 08:42 EDT
-
Struts: Iterating over an Array but creating a list with 2 lines[ Go to top ]
- Posted by: Rene Zanner
- Posted on: August 16 2004 08:42 EDT
- in response to Majid Makki
Hi,
you can define a counter and evaluate the counter - every two iterations you can then insert a <br>:
<logic:iterate name="theArray" id="element" indexId="index">
<bean:write name="element"/>
<%
int idx = index.intValue();
// idx starts with 0:
if (idx % 2 == 1)
{
%>
<br>
<%
}
%>
</logic:iterate>
Hope that helps,
René Zanner