Introduction - If you have any usage issues, please Google them yourself
A simple online store system. Realization of shopping carts.
Design an Item class, including: a commodity like a number, a small meter
(2) design a servlet class
Start the session to take to see if there Hashmap class, which is a shopping cart
The structure of the HashMap class
Key value
Goods the id the Item class
Remove the HashMap from the session:
A. Look at the session there, remove, did not create
2. HashMap key id of the commodity, if the second purchase, the number 1, does not create a new HashMap class
Jump page-> show cart in detail