Say I have a static class A which has several public final static fields.
public class Foo{
public static final String A_STRING = "a_string";
}
And I have also some class which will set a list in session, like this:
List<Bar>barList = getBarList();
session.setAttribute(Foo.A_STRING, barList);
I want to access this list from jsp and iterate through each Bar object and output each Bar objects fields.
What I have come up with this:
<c:forEach items="${sessionScope[Foo.A_STRING]}" var="element">
<tr>
<td>${element.id}</td>
td>${element.name}</td>
...
</tr></c:forEach>
which is not working, any help will be appreciated, thanks.