• Post Reply Bookmark Topic Watch Topic
  • New Topic

Shoppingcart session problem  RSS feed

 
Harry Bos
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,

I`m quite new to jsp but have to build a simple shoppingcart for practice.

I use this code like below:





Now every time i add my first item to the cart it works. But when i add my second item it removes the first item and just adds the second one.

How can i make sure both items will stay in the cart together?

Thanks in advance!
 
Travis Berthelot
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You clear one item when you insert the other. Remember the input fields are in different forms. You really should just use a free E-Commerce program instead of creating your own.

String dvd1 = request.getParameter( "simpsons" );session.setAttribute( "theSimpsons", dvd1); String dvd2 = request.getParameter( "futurama" );session.setAttribute( "futurama", dvd2);
[ October 30, 2004: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!