Web Development with JavaServer Pages

Скачать в pdf «Web Development with JavaServer Pages»


different, as far as a web browser is concerned, from aimless browsing of static pages by a user: the browser transmits a request and gets a response, the user reads the page and takes some action, and the cycle repeats.


As an example of HTTP’s simplicity, consider a web-server feature you might be familiar with.


When a browser asks for a URL that corresponds to a directory of files instead of a particular file name, many servers generate a listing of the files in that directory. It is important to realize that the server generates this listing; it automatically fabricates an HTML message that represents a directory listing, and the browser renders this HTML message just as it would render a static file. (In other words, the browser has no idea that it just requested a list of files.) The very correspondence between the URL and a directory is idiosyncratic to the web server’s configuration; the web server, on its own, establishes this mapping. Likewise, it’s up to web servers to decide whether a particular request will be served from a simple file or dispatched to a JSP page.

2.1.2 GET versus POST


As we discussed earlier, HTTP servers need to wait for requests from web browsers. These requests can come in a variety of forms, but the two request types—formally called methods—that are most important to web developers are called GET and POST.

Скачать в pdf «Web Development with JavaServer Pages»