想请问下关于购物车如何实现

gentoo 02-12-07

能说具体点吗?如何保存用户买的商品,谢谢!

banq
2002-12-07 12:31

通过session保存的。

petstore中就有一个shoppingcart,使用了EJB中的statefull session bean.

每个用户点按商品时,将该商品保存到该用户的session中,用户离开结账时,再从seesion中获取该用户购买商品的清单。

Jevang
2002-12-07 13:10

I think all serious website will persist shoppingcart info into database, petstore store uncheck item inside httpSession, that's not safe, plus it make clustering bit difficult to be realized.
People do usually use httpSession id ( thru coookie or URL rewrite) to identify unauthenticated client, after you login, they will switch to your user id.

Cheers
-Wanchun

gentoo
2002-12-07 15:34

这样的话,只能记录一个session,会被覆盖的啊

Jevang
2002-12-08 02:28

To Gentoo,
Sorry, I did not understand your question.

2Go 1 2 下一页