A Better WayServlets


A Better Way”Servlets

J2EE defines a very complete solution to the challenge of generating dynamic content. The first line of client interaction is the servlet .

What Is a Servlet?

A servlet is a small J2EE component designed to run on a Java Web server. It can receive and respond to requests from clients usually using HTTP. Servlets extend the capabilities of the Web server by having access to the entire spectrum of J2EE services including database access and security. Because they are written in Java, they take advantage of the portability and security that Java offers.

Servlets are created and initialized once and are generally not removed from the Web server during normal operation. Because they have a lifetime that is greater than that of a single HTTP request, there is not the overhead of creating additional operating system processes. This can greatly improve the scalability of the Web server.

Most servlets are able to serve multiple clients simultaneously . The server in which the servlet runs creates a new thread for each client request and dispatches the request to the same instance of the servlet. This is a vast departure from CGI where the Web server creates an entire new operating system process.

Handling HTTP Clients”The HttpServlet Class

Servlets have a specialized class for dealing with HTTP clients such as browsers. The javax.servlet.http.HttpServlet class simplifies the delivery of dynamic content with a unified programming interface to the Web stream. It can drastically simplify the programming task of handling and generating dynamic content.



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net