This project (enlarged from the previous version) allows a store to list its items in one frame and if the user slects the shopping cart one item is added. The number in the shopping cart is changed with each purchase.
The main window is a frameset in the file frameshop.htm. It contains two frames "main" and "cartnumber". The frame "main" is used to display the list of items (this could be a servlet retrieving special items or items found by a search). Each item is followed by the shopping cart icon which is a link to the servlet that adds and item to the shopping cart and updates the count in the "cartcount" frame. One line from the main frame page "mainframe.htm". Notice that the itemId is a string, but you don't need to put quotes around it.
Big Bad Blouse <A HREF = "http://localhost:8080/servlet/shoppingBasket.CartNumber?itemId=2" TARGET="CARTNUMBER"> <IMG SRC = "cart.gif" ALT="Add to my shopping cart"></A>
To get the complete code click here .