I know this isn't hard, but I'm not having any luck.
I want to make fooList
from a Servlet available in a JSP. So in the Servlet I have:
request.setAttribute("list", fooList);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/myJsp.jsp");
dispatcher.forward(request, response);
Then in the JSP, I want:
<c:forEach var="post" items="${SOME_EL_HERE}">
<!-- stuff -->
</c:forEach>
Where SOME_EL_HERE
is an expression that retrieves the attribute that I have set on the request
.
Any thoughts? My preference is to not complicate a simple task by adding a framework, but I'm open to changes in strategy.