<!-- Collection of code snippets by Arne Vajhøj -->
<!-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.*" %>
<%!
public class ForumGroup {
    private String name;
    private List forums;
    public ForumGroup(String name) {
        this.name = name;
        forums = new ArrayList();
    }
    public void addForum(Forum f) {
        forums.add(f);
    }
    public String getName() {
        return name;
    }
    public List getForums() {
        return forums;
    }
}
public class Forum {
    private String name;
    private String description;
    public Forum(String name, String description) {
        this.name = name;
        this.description = description;
    }
    public String getName() {
        return name;
    }
    public String getDescription() {
        return description;
    }
}
%>
<%
// start test data
ForumGroup fg1 = new ForumGroup("Gruppe 1");
fg1.addForum(new Forum("Forum A", "A A A A A A A A A A A A A A"));
fg1.addForum(new Forum("Forum B", "B B B B B B B B B B B B B B"));
ForumGroup fg2 = new ForumGroup("Gruppe 2");
fg2.addForum(new Forum("Forum C", "C C C C C C C C C C C C C C"));
fg2.addForum(new Forum("Forum D", "D D D D D D D D D D D D D D"));
List groups = new ArrayList();
groups.add(fg1);
groups.add(fg2);
request.setAttribute("groups",groups);
// slut test data
%>
<table border>
<c:forEach var="g" items="${groups}">
<tr>
<td>${g.name}</td>
</tr>
<tr><td>
<table border>
<c:forEach var="f" items="${g.forums}">
<tr>
<td>${f.name}</td>
<td>${f.description}</td>
</tr>
</c:forEach>
</table>
</td></th>
</c:forEach>
</table>
