It depends a little on what technology you want to use. I seem to recall a fairly useful JSP shopping cart tutorial on the web somewhere (maybe here or here, but keep looking) [This message has been edited by Frank Carver (edited November 07, 2000).]
Hi Frank, Thanks for the links.Actually regarding the ttechmologies, that is what I am confused about .I am quite new to servlet technology and is on my self study. I was thinking of servlets and html. Is that possible or Do I HAVE to use JSP and Beans. I do not have very good idea on these technologies. Can you please enlighten me Thanks Debanjana
Joined: Jan 07, 1999
Good question. You don't need JSP or Beans to do this sort of stuff. To be portable to all browsers you have to use a simple subset of HTML as your user interface. You can generate this however you like - using print statements in your servlet code, using a HTML builder tool like ECS, using some sort of templating mechanism like WebMacro or Velocity, using page-compilation techniques like JSP, or even generating XML and pasing it through an XSL stylesheet. The bottom line with all these methods, though, is that you produce some sort of dynamically generated HTML based on the items you have stored in your "cart". As for how you store the items in the cart; you can keep them in a database managed by your code doing "SELECT" and "UPDATE" statements through JDBC, you can keep them in memory and hope the servlet stays alive, you can use your own custom file format, you can use Enterprise Java Beans to store the data in a database automatically or many other possibilities. Some people use JSP and Beans because they work fairly well together, and they are favoured by Sun. Others swear by templating systems or independent persistent storage layers. Essentially you have to make up your own mind which you want to use. If you are just learning, just pick some combination of technologies and try to make it work. If you are producing a commercial e-commerce product, you need to look a lot harder at the differences between the technologies, and decide how much flexibility, scalability, maintainability, ease of deployment, separation of tasks etc. the various solutions provide in your situation.
Joined: Aug 11, 2000
Hi Frank Thanks again I think since I am in the learning stage I will go ahead with simple html user interface . after I complete this, i will use JSP and Beans. I will follow one of your suggested methods for storing the items, probably JDBC. I think I can make it work. Thanks again Debanjana