Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When we think about the World Wide Web, we normally think of applications—web browsers, web servers—and the many kinds of content that those applications move around the network. But it's important to note that standards and protocols, not the applications themselves, have enabled the Web's growth. Ever since the first days of the Internet, there have been ways to move files from here to there, and document formats that were just as good as HTML, but there was not a unifying model for how to identify, retrieve, and display information; nor was there a universal way for applications to interact with that data over the network. As we all know, HTML came to provide a common data basis for documents. In this chapter, we're going to talk about how to use HTTP, the protocol that governs communications between web clients and servers, and URLs, which provide a standard for naming and addressing objects on the Web.
In this chapter, we're also going to talk about web programming: making the Web intelligent, making it do what you want. This involves writing code for both clients and servers. Java provides a powerful API for dealing with URLs, which will be the first focus of our discussion. Then we'll discuss how to write web clients that can interact with the standard CGI interface, using the GET and POST methods. Finally, we'll take a look at servlets, simple Java programs that run on web servers and provide an effective way to build intelligence into your web pages. Servlets have been one of the most important and popular developments in Java over the past couple of years.