I\'m trying to iterate through a List of Maps using s:iterator. I can iterate through the List without problems, but I can not get it to iterate through the entries of the map.
Here is a demo that loops through lists of map:
import com.opensymphony.xwork2.ActionSupport;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class mapTest extends ActionSupport {
public List
Here is the JSP to render it:
<%@taglib prefix="s" uri="/struts-tags"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
Map Test
List #
key
value
Note the inner iterator is context sensitive it will use the last value pushed onto the stack. The status attribute gives us a IteratorStatus object each iteration which is useful if we want to know the current iteration.