File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes forEach not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "forEach not working" Watch "forEach not working" New topic
Author

forEach not working

Bob Dunn
Greenhorn

Joined: Jun 23, 2011
Posts: 12
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Jun 23, 2011
Posts: 12
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)

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: forEach not working