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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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?
subject: Problem with c:forEach Tag
Similar Threads
problem updating quantity field
How To Convert a Servlet File to a JSP File
Storing of Data
trouble with remove item fro shopping cart
Why doesn't exercise 8-1 from Murach's Java Servlets work for me on IE7?