JSP Tag Libraries

Скачать в pdf «JSP Tag Libraries»


Get


-►


Browser


* Reply

yi/e1


Figure 1.1 An HTTP client and server


The Web is a client/server application on a huge scale. The client (a browser) connects to the server (also known as a web server or an HTTPserver) using a protocol called HyperText Transfer Protocol (HTTP). The server then returns content to the browser which presents this content (for example, as a GIF image or an HTML page) to the user.


Each client/server connection is initiated by the browser and the browser alone. This procedure begins by opening a TCP/IP connection to the


server and sending an HTTP request. The server then processes the incoming request and returns an HTTP response. These requests and responses follow a very specific, yet simple, syntax as specified by the HTTP protocol.

1.2.1 HTTP protocol


Since HTTP is a pull technology, meaning that a connection starts when a client requests a document, we start our discussion with the request.

The HTTP request


An HTTP request begins with a request line whose structure is http-method request uri http-version, and is terminated with the carriage return-line feed characters. The http-method portion of the request line should be one of the methods defined in the HTTP protocol specification:


■    get—This asks the server to serve a resource as referenced in the request-uri. Request parameters should be coded in the request-uri. This is the method your web browser uses when you type in a URL for it to retrieve.


■    post—Similar to get, except that post contains a body wherein the request parameters are encoded. A web browser most often uses this method to submit HTML forms, such as those you fill out when making an online purchase.

Скачать в pdf «JSP Tag Libraries»