This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL error  RSS feed

 
SachinJ Joshi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I facing issue with nested <c:forEach in my jsp page.
I am using jstl.jar

Here is my code
in JAVA I have -->
List<ProductDefViewBean> productList = new ArrayList<ProductDefViewBean>();
productList.add(objProductDefViewBean);
request.setAttribute("ProductList", productList);
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

in JSP
<c:forEach var = "outer" items = "${ProductList}">

<c:forEach var ="inner" items = "${outer}">

<c:out value="${inner.productName}" />

</c:forEach>

</c:forEach>
It gives me below error....
[3/11/14 11:08:53:913 EDT] 00000020 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /ProductDefinitionHome.jsp. Exception thrown : javax.servlet.ServletException: Don't know how to iterate over supplied "items" in <forEach>

javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach>
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ProductDefViewBean" does not sound like something you could iterate over (like the error message says). Is it an Iterable object? If not, what is the inner loop supposed to accomplish?
 
SachinJ Joshi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:"ProductDefViewBean" does not sound like something you could iterate over (like the error message says). Is it an Iterable object? If not, what is the inner loop supposed to accomplish?


This is resolved. Thanks...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!