• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Shoppingcart session problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic