Chapter 3. Basic Web Concepts

Java can do a lot more than create flashy web pages. Nonetheless, many of your programs will be applets on web pages, servlets running on the server, or web services that need to talk to other web servers and clients. Therefore, it’s important to have a solid understanding of the interaction between web servers and web browsers.

The Hypertext Transfer Protocol (HTTP) is a standard that defines how a web client talks to a server and how data is transferred from the server back to the client. The architecture and design of the HTTP protocol is Representational State Transfer (REST). HTTP can be used to transfer data in essentially any format, from TIFF pictures to Microsoft Word documents to DBase files. However, far and away the most common format for data transferred over the Web and in some sense the Web’s native format is the Hypertext Markup Language (HTML). HTML is a simple standard for describing the semantic value of textual data. You can say “this is a header”, “this is a list item”, “this deserves emphasis”, and so on, but you can’t specify how headers, lists, and other items are formatted: formatting is up to the browser. HTML is a “hypertext markup language” because it includes a way to specify links to other documents identified by URLs. A URL is a way to unambiguously identify the location of a resource on the Internet. To understand network programming, you’ll need to understand URLs, HTML, and HTTP in somewhat more detail than the average ...

Get Java Network Programming, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.