Results 1 to 1 of 1
- 04-18-2011, 09:41 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Help with Struts2 tags and Array indexer
Hello. I am having difficulty with a 'for loop' accessing an array item while using the for loop's counter. Can someone show how I can use the 'index' variable as an array element? In my code below I hard-coded '0'.
The code I have looks like:
<s:hidden name="Party.name1" value="%{Party.name1}"/>
<% for(int index=0; index < Party.name1.sizeof(); index++) { %>
<tr>
<td><s:property value="%{Party.name1[0]}" /></td>
</tr>
<% }
%>
I would use an iterator but the Java code that I am binding with is passing back multiple Arrays that need to be looped through within the same for loop.
Similar Threads
-
struts2 tags problem
By videanuadrian in forum New To JavaReplies: 0Last Post: 12-10-2010, 10:47 AM


LinkBack URL
About LinkBacks

Bookmarks