Chapter 2: The Servlet 2.3 API

 < Free Open Study > 



Overview

The current version of the Java Servlet API, 2.3, provides a mature technology for developing J2EE and J2SE-based web applications based around servlets.

The entire Servlet API is contained in two packages: javax.servlet and javax.servlet.http. The first package deals with generic servlets, and the second deals with specialized HTTP servlets.

The API contains 20 interfaces and 16 classes. The prevalence of interfaces in the API allows servlet implementations to be customized and optimized to the requirements of a specific servlet container. For example, the API specifies servlet request and response interfaces, but the container provides the underlying class implementations for them. From the container vendors' point of view, this allows it to determine the optimal implementation, given the characteristics and requirements of the container and the clients' requirements for the web application. These could include such objectives as optimization for HTTP access.

As developers, we don't need to know the details of how these classes have been implemented by the container. It is sufficient to be able to access methods within the classes according to the contract specified by the interface.

During the course of this chapter:

  • We will examine the classes and interfaces of the Servlet API, focusing particularly on the javax.servlet package.

  • We will also be considering the classes and interfaces related to lifecycle of a servlet

  • We'll look at the request-response cycle, and the interfaces and classes associated with it

  • We will conclude the chapter by developing an application using the servlet classes and interfaces that we will discuss.



 < Free Open Study > 



Professional Java Servlets 2.3
Professional Java Servlets 2.3
ISBN: 186100561X
EAN: 2147483647
Year: 2006
Pages: 130

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