i have a simple question on e-shop cart.I have a table in sql called products, were i store my products.Is it right to use a vector to keep track of the products the customer buys and then using a servlet to insert,delete and show products?
Cookies only store strings, not vectors, so parts of your question do not make sense. Also, vector is an outdated class, ArrayList is preferred (details not important for this post though)
Session variable storage and management is far from "simple". Generally, you often use a cookie to keep a list of unique product ids and quantities for the items the customer has added to their cart as a string such as:
myItems = "4923=1&14591=4?19491=2"
which represents 1 of item 4923, 4 of item 14591, and 2 of item 19491 although the format is completely up to you. The String.split() is particularly useful for decoding these values. [ November 01, 2005: Message edited by: Scott Selikoff ]