Duke's Bookstore Sample Application

  Samples Index

Duke's Bookstore Sample Application

This document describes how to use the Duke's Bookstore sample application in conjunction with the Application Server.

Overview


The Duke's Bookstore sample application illustrates the tasks involved in programming using web technologies. The application allows users to retrieve available books from a database table, display details of the book, add books to and remove books from a shopping cart, and check out books. The application showcases web technologies such as servlets, monitoring servlet lifecycle events, and filters.

Directory Structure

The bookstore sample and its associated files are kept under the samples/webapps/apps/bookstore directory
File Description
bookstore All files relating to bookstore sample.
docs docs for bookstore.
common common files, like sql.

The bookstore sample has build.xml and deployment descriptors under the src directory. (e.g. bookstore/src).

Compiling and Assembling the Application


This section contains instructions to build and assemble the Duke's Bookstore sample application.

To compile, assemble and deploy the application, see the Sample Application Build Facility document for details on using asant facility to quickly perform these tasks.


NOTE: You must start the Database before deploying and running the sample application. For more information, see How to start Database.

Deploying the Application

In this section, you will learn how to deploy the Duke's Bookstore sample application.

To deploy the application:

Note: You must run asant undeploy before redeploying this sample. This will ensure that all modules are undeployed and the resources are disabled.



To undeploy the application,:

Running the Application


To run the sample application, you must first:

You can then run the application by opening the following URL in your browser
http://<host>:<port>/bookstore/enter

The bookstore sample has build.xml and deployment descriptors under src directory. (e.g. bookstore/)

The following images are from running the bookstore sample.



Figure 1    Duke's Bookstore: "Start Shopping" link



Figure 2    Duke's Bookstore: Shopping Cart



Figure 3    Duke's Bookstore: Cashier


Generating Javadocs

To better understand sample application source code, you may refer to the related Javadocs.

To generate Javadocs, run one of the following commands:

asant javadocs

or

asant all

After you have generated Javadocs, you may access them at samples/webapps/apps/bookstore/javadocs/index.html.

Troubleshooting


If you encounter problems when running the application, try the following:


Copyright © 2004 Sun Microsystems, Inc. All rights reserved.

Last Updated March 6, 2004