This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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