Java Reference
In-Depth Information
When using the WebStocks Web application, the first Web page a user views
is a static Web page that provides the user with a form to enter a user ID and
password. After the user ID and password are verified, the user can view addi-
tional dynamic Web pages that allow the user to manage stock holdings; if the
user is an administrator, access is provided to user information. These functions
are the same as those provided by the StockTracker application created in
Chapter 11, except in a Web-enabled format. Additionally, the WebStocks Web
application has the ability to obtain a stock quote for any user with at least one
stock holding (Figure 12-1c). The Web pages providing the user interface for
managing stocks, displaying stock quotes, and managing user accounts are
dynamic Web pages created either by a servlet or a JSP.
The WebStocks Web application also uses the data access class,
StockTrackerDB, to provide access to the database on the server via JDBC™
(Figure 12-1d). Depending on the application, the database could exist on a
server separate from the Web server and the client machine (a multi-tier archi-
tecture) or on the same machine as the Web server (a two-tiered architecture). In
this chapter, a two-tiered client/server architecture will be used, so the database
will reside on the same computer as the Web server. Further, to facilitate testing,
both the client (the Web browser) and the server (the Web server software) will
execute on the same physical machine.
static Web page
for log in
a) Client running Web
browser
HTML/JSP Servlet
Two-tier client/server
boundary
dynamic Web
page displays
stock quote
d) StockTrackerDB
Data Access Class,
JDBC™
b) Web server
Database
c) Web server
(stock quote Web
service provider)
client (Web browser), server
(Web server software), and
database on one physical
machine to facilitate testing
FIGURE 12-1
 
Search WWH ::




Custom Search