J2EEOnline J2EE

Web Perl   «Prev  Next»
Lesson 6 How HTTP communicates
ObjectiveEvaluate strengths/ weaknesses of server/client interface.

How HTTP Communicates

Evaluate the strengths and weaknesses of the Web server/client interface.

The HTTP connection is always initiated by the client, and the request always precedes the response. After the response is sent, the server may break the connection. In newer versions of HTTP (for example, HTTP/1.1), the client may request a persistent connection, but the server cannot guarantee that it will be able to keep the connection alive.
The HTTP protocol allows clients and servers to communicate across all the different platforms that support TCP/IP, which is in fact what makes the Internet possible. The fact that the connection is not persistent makes it efficient with the limited resources of the Internet, allowing the server to provide access to many simultaneous clients.
This lack of persistence also presents some unique challenges to the programmer:
  1. How do you know which client is the one that you just sent some piece of data to?
  2. How can you distinguish different clients that may have the same IP address?
  3. How do you know that a client even got the data you just sent?
When compared with other multimedia architectures that you may have worked with, HTTP has certain unique strengths and weaknesses that you will want to consider when creating interactive applications:


  1. Works across all platforms that support TCP/IP
  2. Allows clients to send data to servers
  3. Is efficient with the limited resources of the Internet


  1. Makes it difficult to keep a session context
  2. No inherent client identification available
  3. No guarantee that data gets back to the client
The CGI interface gives us some tools for taking advantage of the strengths, and overcoming the weaknesses, of this architecture.

CGI - Server - Exercise

Click the Exercise link to prepare and test your server.
CGI - Server - Exercise
In the next several lessons you will get a brief introduction to CGI, and an example of a simple CGI program that you may test on your server.