Java Reference
In-Depth Information
Chapter 8
Servlets
So far, we have focused on client-based (desktop) applications. In this chapter, server-side (Web-based) applications
are introduced, and the advantages and disadvantages of client versus server-based applications will be explained.
There will be a short tutorial on HTML (Hypertext Markup Language) and then we will show how easy it is to create
Web pages using RAD's Page Designer rather than entering HTML. We will then explain and create a Java servlet
(i.e., a Web-based Java class), demonstrate how to tie a Web page to a servlet, and show how to pass information
from a Web page to a servlet using a form.
In this chapter, you will learn about:
HTTP
HTML
Forms
The Web Perspective
Application Servers
Requests and Responses
Page Designer
After this chapter, you should be able to:
Create a Web page with a form
Create a servlet that retrieves and displays information from a Web page
Run Web pages and servlets on RAD's application server
What is a Server?
A server, of course, is a computer. However, that simple definition is like saying a coin is metal. True, a coin is metal,
but a coin is much more than metal. Saying that a server is a computer describes only one aspect of a server (and
not a very illuminating aspect), because not every computer is a server. What makes a computer a server is software,
specifically, server software. Of course, the computer has to be “connected” to the Internet and to add a server to the
Internet; the “Internet overseers” must be paid. However, we will leave a detailed discussion of how to set up a server
for a different text and instead concentrate on how to create Java programs for a server.
To make things a little more confusing, there are many different types of Internet servers. For instance, email
servers, Web page servers, and application servers are three different types of servers. What makes each server
different is the type of information that is transferred and the protocol (or rules) that are followed to transfer
the information. As a matter of fact, the Internet is really just a collection of protocols that specify how to send
 
Search WWH ::




Custom Search