Servlet API Classes and Interfaces





Servlet API Classes and Interfaces

The J2SDKEE 1.3 API contains a rich set of classes and methods that enable the servlet developer to code complex Web applications in a well-implemented manner. The API is contained in three packages:

  • javax.servlet

  • javax.servlet.http

  • javax.servlet.jsp

Each package contains several interfaces and classes that define the API. In this section we will only briefly cover the javax.servlet and javax.servlet.http packages. The classes in the javax.servlet.jsp package will be discussed later. As we look at the interfaces defined in these packages, you should understand that the servlet engine provider would supply implementations for these interfaces. However, you will want to write code which only uses the API as it appears in an interface where supplied and not any vendor-specific class.

1 javax.servlet package

The javax.servlet package contains the basic API for servlets but is not tied to a particular scheme or protocol for how servlets may be used. See Figure for a list of the classes and interfaces in the javax.servlet package.

javax.servlet package interfaces/classes.

Interfaces

Filter

FilterChain

FilterConfig

Request Dispatcher

Servlet

ServletConfig

ServletContext

ServletContextAttributeListener

ServletContextListener

ServletRequest

ServletResponse

SingleThreadModel

Classes

Generic Servlet

ServletContextAttributeEvent

ServletContextEvent

ServletInputStream

ServletOutputStream

ServletRequestWrapper

ServletResponseWrapper

Exceptions

ServletException

UnavailailableException

2 javax.servlet.http package

The javax.servlet.http package contains the API for servlets that will be used as HTTP servlets. See Figure for a list of the classes and interfaces in the javax.servlet.http package.

javax.servlet.http package interfaces/classes.

Interfaces

HttpServletRequest

HttpServletResponse

HttpSession

HttpSessionActivationListener

HttpSessionAttributeListener

HttpSessionBindingListener

HttpSessionContext

HttpSessionListener

Classes

Cookie

HttpServlet

HttpServletRequestWrapper

HttpServletResponseWrapper

HttpSessionBindingEvent

HttpSessionEvent

HttpUtils

For a more details on the servlet API refer to the servlet API Javadocs available from the Help menu in WebSphere Studio, and also for download from http://java.sun.com.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows