File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Problem with c:forEach Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with c:forEach Tag" Watch "Problem with c:forEach Tag" New topic

Problem with c:forEach Tag

Vidya Moorthy
Ranch Hand

Joined: Nov 13, 2003
Posts: 57
Hi all
I am trying to learn JSP Core tags from a book. I am following the sample code in the book for a cart jsp and on pressing update or remove button, it sends it to a servlet showCart. I will post the code for both of them below. The problem is while I click the first product in the cart and click on update, it does the job. For any other product in the cart, it doesn't update the vaule and show the new amount. Please let me know the mistake.

This is the code for the servlet

Thanks in advance
[ September 23, 2008: Message edited by: Bear Bibeault ]
John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
Rather that repost this, i am having this same exact problem. As i debug in eclipse no matter what row i am on it always grabs the first row of the cart. I assume its because all the qty textfields have the same name, but how would you correct this in the loop?
I agree. Here's the link:
subject: Problem with c:forEach Tag
jQuery in Action, 3rd edition