Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with c:forEach Tag

 
Vidya Moorthy
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Vidya
[ September 23, 2008: Message edited by: Bear Bibeault ]
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic