|
Source Code Archive
More Servlets and JavaServer Pages
Chapter 6: A Sample Web Application: An Online Boat Shop
To view source code for other chapters in this book, mouse over the table of contents bar on the left.
Source Code from Chapter
Note: right-click or shift-click on the links to download the associated file.
- web.xml.
Deployment descriptor for the
boats application.
- index.jsp.
Top-level page of the
boats Web application.
Uses the app-styles.css
style sheet and the
yacht.jpg
image file.
- images/. Various
image files used in the
boats application.
-
CounterTag.java. Custom tag that outputs a Web-app-specific hit count.
-
Count.java. Simple bean used by
CounterTag.
-
count-taglib.tld. Tag library descriptor file that associates
the
CounterTag code with the base tag
name of count.
- yachts.jsp.
First of the three second-level pages that describe specific varieties
of boats. This one is on yachts. Uses the
app-styles.css
style sheet.
- tankers.jsp.
Second of the three second-level pages that describe specific varieties
of boats. This one is on oil tankers. Uses the
app-styles.css
style sheet.
- carriers.jsp.
Last of the three second-level pages that describe specific varieties
of boats. This one is on aircraft carriers. Uses the
app-styles.css
style sheet.
-
ShowItem.java. Servlet that looks up information on an item that is for
sale. Uses the MVC architecture, storing the data in
a
SimpleItem object and using either
ShowItem.jsp or
MissingItem.jsp for the presentation.
- ShowItem.jsp.
Page that uses
jsp:useBean to access the
SimpleItem object that was created by the
ShowItem servlet. Uses that object to look up the
item’s description, its cost, and the location of an
image file that illustrates it (see
images/).
- MissingItem.jsp.
Page used by the
ShowItem servlet when the item number is missing.
-
ShipTable.java. A collection of
SimpleItem
objects that describe ships.
-
SimpleItem.java. Bean that describes an item that is for sale.
Used by the
ShowItem servlet to store the data that the JSP pages will later
retrieve and display.
-
ShowPurchases.java. Page that shows a table of purchases.
Illustrates simple session tracking. Uses
sucker.jsp to display the
result.
-
ItemList.java. Very simple pseudo shopping cart. Maintains a list
of items and can format them in an HTML table.
Used in the
boats example to show that
each Web app maintains its own set of sessions.
- sucker.jsp.
Page that displays all items being purchased
by client in the current session.
- boats.war.
The entire
boats application bundled in
a WAR (Web ARchive) file.
More Information
-
J2EE training courses from the author. Available on-site at your
company or at public venues.
- Free online version of
Core Servlets & JavaServer Pages.
Complete text of book in PDF.
-
Home page for Core Servlets and JavaServer Pages 2nd Edition (Vol 1).
Includes the table of contents, index, sample chapters, source code archive, etc.
-
Home Page for More Servlets and JavaServer Pages.
Includes the table of contents, index, source code archive, etc.
-
Free online version of More Servlets and JavaServer Pages.
- Servlet and JSP Programming Resources.
Download sites, servers, IDEs, tutorials, books, job listings, and more.
-
Tutorials and lecture notes on servlets, JSP, Struts, JSF, and Java 5.
PDF version free for all. PowerPoint version free for qualified university instructors.
- Servlet and JSP
programming resources. Specs, documentation, servers, IDEs,
hosting providers, books, training, etc.
- Java Programming Resources.
General resources on Java technology. Compilers, editors, IDEs, tutorials, books,
user forums, and more.
|