I have the following class:
public class User {
private String username;
private String password;
private List<Integer> roles;
// Getters and Setters
}
I have a JSP that views all of the users currently registered. So I want it to be a summary of their username and the roles that they possess. Roles is the list that contains an index of the pages they can view.
Example:
+------------+--------+--------+--------+
| Username | Page 1 | Page 2 | Page 3 |
+------------+--------+--------+--------+
| user1 | ✔ ✔ |
+------------+--------+--------+--------+
| user2 | ✔ ✔ |
+------------+--------+--------+--------+
| user3 | ✔ ✔ |
+------------+--------+--------+--------+
Right now this is what I have:
<table cellpadding= "5">
<tr>
<th>Username</th>
<th>Page 1</th>
<th>Page 2</th>
<th>Page 3</th>
</tr>
<c:forEach items="${users}" var="user">
<tr align="left">
<td>
<c:out value="${user.username}"/>
</td>
/*insert conditional here*/
</tr>
</c:forEach>
</table>