Chapter 12. Programming for the Web
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access