• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forEach not working

 
Bob Dunn
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm adding a forEach statement in the index.jsp page and it's not working. I'm using netbeans and item.product.description line is highlighted and the error/warning is "Multiple Breakpoints". I'm not sure what Multiple Breakpoints mean.





web.xml

 
Paul Clapham
Sheriff
Posts: 21119
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means something about the breakpoints you've configured so you can do debugging in Netbeans. It doesn't mean anything about your code at all. Did the message actually prevent you from running that code, or did you just not try when you saw the message?
 
Bob Dunn
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run it I get a 500 error.

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 20

17: <td align="left"></td>
18: </tr>
19:
20: <c:forEach var="item" items="${products.items}">
21: <tr valign="top">
22: <td>${item.product.code}</td>
23: <td>${item.product.description}</td>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cart.ProductsServlet.processRequest(ProductsServlet.java:28)
cart.ProductsServlet.doGet(ProductsServlet.java:40)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.NumberFormatException: For input string: "items"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
java.lang.Integer.parseInt(Integer.java:449)
java.lang.Integer.parseInt(Integer.java:499)
javax.el.ListELResolver.coerce(ListELResolver.java:167)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic