Infotechie
Infotechie

Reputation: 1653

accessing a list set in bean in jsp

In a bean "Result", an arrayList "tempList" is set.This bean is then set into session. I have to fetch arrayList elements on JSP page.

I am not getting the way of how to fetch its elements.

Please suggest.

Upvotes: 0

Views: 244

Answers (1)

Igorry
Igorry

Reputation: 177

Use JSTL <c:forEach>:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...
 <c:forEach items="${youSessionAttributeName}" var="i">
    Item <c:out value="${i}"/><p>
 </c:forEach>

Upvotes: 1

Related Questions