Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Struts2 - <s:iterator> in two-Dimensional Array. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 - <s:iterator> in two-Dimensional Array." Watch "Struts2 - <s:iterator> in two-Dimensional Array." New topic
Author

Struts2 - <s:iterator> in two-Dimensional Array.

Paul Michael Serrano
Ranch Hand

Joined: Nov 22, 2004
Posts: 59
Good Day,

I would like to ask how am I going to extract the data object from my 2-dimensional array using <s:iterator>?

In my action class, I do have....


And in my jsp,

what should be the values of my second <s:iterator> tag?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

I think id attribute is depricated. You should try this



I think you don't need to give anything in the value attribute i.e. remove the value attribute altogether and still it will work as the inner iterator will iterate over the 1-D array that is placed on the top of the value stack by the outer iterator...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Paul Michael Serrano
Ranch Hand

Joined: Nov 22, 2004
Posts: 59
Thanks Ankit.
 
jQuery in Action, 2nd edition
 
subject: Struts2 - <s:iterator> in two-Dimensional Array.
 
Similar Threads
Struts 2 Iterating in ArrayList containing object Array
Struts 2: mathematical operations on status.index
help needed with iterator tag in struts2
How do I access a list which is in a Map using Struts 2 tags.
s:iterator - situation