tion in the browser session), and finally to route the
processed request to the appropriate JSP in the Presentation
The Controller employs two packages to control the
model and the view sections i.e. roseindia.web.struts.form (contains varous Action Forms) and roseindia.web.struts.action (contains varous Action
I The package roseindia.web.struts.form contains 10
II The package roseindia.web.struts.action contains 16
The Business layer is responsible for processing the
application’s business logic. The Business layer is responsible
for managing a cart. It creates a representation
of a new cart object needed to choose, remove and
update the various items in the cart, and then communicate
with the Data Access layer to store a representation
of the cart in the database.
The Data Access layer is responsible for writing and
retrieving data to and from the database, and returning
the results to the Business layer.
The Model is organized into six packages where classes are
devoted to interact with the database and to process business
1 The roseIndia.dao package contains the ShoppingCartDAOImpl class implementing the
ShoppingCartDAO interface. ShoppingCartDAOImpl class
deals with all database related concern of administrator and
customer sections of the application.
2. Package roseindia.dao.hibernate contains 7 java lasses
and 7 hibernate mapping xml documents (*.hbm.xml). hese
classes and xml documents does java-Object relational
mapping with the underlying database.
3. The package roseindia.services contains a single class
ServiceFinder needed to retrieve various integrated services
from Spring Application context.
4 The package roseindia.web.cart is the heart of the whole
application. It contains 2 main classes which enable to add,
update and remove items into a shopping cart.
5 The package roseindia.web.common contains various
helper and utility classes needed to process the business
The Presentation Layer
After the Web Controller layer routes the request to
the Business layer and retrieves the results of the processing,
it then forwards the request to the Presentation
layer, which is responsible for generating the HTML sent
to the user’s browser.
Getting Shopping Cart Code
We are maintaining the code and documentation of the
shopping cart at http://www.roseindia.net/shoppingcart/. Here,
you can download the latest version of the shopping cart
Basically, a shopping cart is the interface between a
company’s Web site and its deeper infrastructure. This allows
customers to select merchandise; review their selection, make
necessary modifications or additions; and finally purchase the
Companies integrate shopping carts as these are sold as
independent pieces of software into their own unique online
solution. There are number of shopping carts available like
LaGarde, RomanCart, AgoraCart etc. For instance the PayPal
Shopping Cart is a low-cost way for you to accept credit card
and bank account payments, and can be fully integrated with
your website in a few easy steps.
Features of a shopping cart:
I Easy-to-use store management tools, saves time and
II Customizable for your business needs.
III Easy to implement - no CGI scripting necessary.
IV Improve buyer experience - with customizable buttons
and secure payments happy customers becomes a
V Customizable HTML store home page.
VI Order forms are in HTML for ease of customization.
VII Upload and store static html pages for product info,
VIII Dynamically generated product pages from store’s
Developing a Shopping Cart Application
We are providing relevant details to develop an e- commerce
application (a shopping cart) with Struts, Hibernate and
Features provided in the shopping cart
• Customers Registration: Existing user can login to the
shopping cart by signing in using their username and
password. Moreover they can update their profile suchas address, contact number, Email-id etc.
July 2007 | Java Jazz Up | 40
|Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
|31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , Download PDF