Chapter 8. More About Saving Data
In this chapter
In Chapter 5, "Saving Data Between Requests," you learned how to store data between user requests using a session object. Although there are many uses for the session object, one of the most common uses is storing items for online shopping. When you shop online, you usually browse around the Web site, occasionally clicking an "Add to Shopping Cart" button to signal that you want to buy something. When you are done, you click "Check Out" and fill out your billing information.
The session object is a logical place to keep shopping cart data. You could, of course, keep the data on the client's browser. It can get pretty cumbersome trying to keep up ...
Get Special Edition Using Java™ Server Pages and Servlets now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.