Databases Reference
In-Depth Information
e
So you want a fortune. - Microsoft Internet Explorer
e
*
Back Forward Stop Refresh Home Search Favorites History Channels Fullscreen Mail Print Edit
e
Address
http://27.0.0.1/Fortune.html
Links e
e
e
e
e
Best of the Web
Channel Guide
Customize Links
Internet Explorer News
Internet Start
File Edit View Go Favorites Help
700 Quotations as of 10/19/98!!!
So you want a fortune/quotation, huh? Don't we all...
We got good ones and bad ones, so take a chance and grab one (or many)...
I'm daring enough to push this button!
ADDED 10/19/98: SEARCH THE QUOTATION DATABASE BY
KEYWORD!!!!
(Be patient, as the search may take some time.)
Text you want to search for:
Search
e
e
Internet zone
Done
Exhibit 34-7. Visual representation of the HTML displayed in Exhibit 34-6.
three-tier example that does just this. Here, the application logic (user
interface) we don't even need to worry about — Microsoft, Netscape, and
others have done the work for us. The servlet is the business logic which
is going to mediate access between the client and the RDBMS. The servlet
can be considered middleware, a vague term that refers to all the software
needed to support interactions between clients and servers.
The first thing we're going to do before we even write a servlet, however,
is to concentrate on the Fortune/Quotation server. The code for this
project component is shown in Exhibit 34-8.
How Does the Server Work?
Let's examine the code and get a general idea of what's going on here,
and how this component can be used in conjunction with servlets to com-
plement our project. First, notice that the
FortuneServer
class is a sub-
class of
methods and data
members, and the methods will remain as written unless we explicitly
override them by redefining their behavior. The server is going to be a mul-
tithreaded process so it can capably handle many concurrent requests.
Thread
. This means that it has all of the
Thread
The
FortuneServer
begins by executing code contained in its
main()
method. It is here that we simply create a new
, and then start
the thread that the application just spawned. We should briefly look at the
class constructor to see what happens when we create a new
FortuneServer
FortuneServer
Search WWH ::




Custom Search