MY mENU


Tuesday 17 April 2012

Servlets Introduction


Servlets are Java technology’s answer to Common Gateway Interface (CGI) programming. They are programs that run on a Web server, acting as a middlevlayer between a request coming from a Web browser or other HTTP clientvand databases or applications on the HTTP server. Their job is to:


1. Read any data sent by the user. This data is usually entered in a form on a Web page, but could also come from a Java applet or a custom HTTP client program.

2. Look up any other information about the request that isvembedded in the HTTP request.
This information includes details about browser capabilitie,vcookies, the host name of the requesting client, and so forth.


3. Generate the results. This process may require talking to a database, executing an
RMI or CORBA call, invoking a legacy application, or computing the response directly.


4. Format the results inside a document. In most cases, this involves embedding the information inside an HTML page.


5. Set the appropriate HTTP response parameters. This means telling the browser what type of document is being returned (e.g., HTML), setting cookies and caching parameters,
and other such tasks.


6. Send the document back to the client. This document may be sent in text format (HTML), binary format (GIF images), or even in a compressed format like gzip that
is layered on top of some other underlying format.

No comments:

Post a Comment