- Implementing a Client
- Parsing Strings by Using StringTokenizer
- Example: A Client to Verify E-Mail Addresses
- Example: A Network Client That Retrieves URLs
- The URL Class
- WebClient: Talking to Web Servers Interactively
- Implementing a Server
- Example: A Simple HTTP Server
- RMI: Remote Method Invocation
Java sockets let you create network clients or servers that can communicate with general-purpose network programs written in any language. The process of building a client is straightforward: open a socket, create input and output streams from the socket, use these streams for communication, then close the socket. A server is similar but waits for an incoming connection before the socket can be created. Both types of systems frequently need to parse input they receive, and a StringTokenizer is a convenient tool for this. RMI is a powerful and convenient alternative when distributing processing among Java-only systems.
In the next part of the book we focus on server-side programming. First, we cover HTML forms as front ends to servlets or other server-side programs such as CGI scripts. These forms provide simple and reliable user interface controls to collect data from the user and transmit it to the servlet. Following that, we cover Java servlets, which run on a Web server, acting as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTTP server. Next, we cover JavaServer Pages (JSP) technology to enable you to mix regular, static HTML with dynamically generated content from servlets. In addition, we show you how to write applet front ends to send data to HTTP servers through firewalls by means of HTTP tunneling. Also, we present the JDBC API, which allows to you send SQL queries to databases; and finally, we examine the Java API for XML parsing to process XML files.