The Servlet API

Estudies4you
Interfaces of javax.servlet package
The Servlet API
As name states, this contains the API to develop Servlet
  • Below are two packages that are required to build servlets.
    • javax.se       rvlet
    • javax.servlet.http
The Servlet API is supported by most Web servers
  • javax.servlet : Package contains many interfaces and classes that a re-used by the servlet or web container. These are not specific to any protocol
  • javax.servlet.http : Package contains interfaces and classes that are responsible for http requests only
javax.Servlet Package
Package contains many interfaces and classes that support servlet to run. Lets see important Interfaces and Classes under this package

Interfaces of javax.servlet package
Servlet
Defines the life cycle methods of a servlet
ServletRequest
Used to read data from client request
ServletResponse
Used to write data to a client response
ServletConfig
Allows servlet to get initialization parameters
UnavailableException
Allows servlet to access information about env
RequestDispatcher
Able to dispatch request from client to any resource on server.
GenericServlet
Implements Servlet, ServletConfig and Serializable
ServletlnputStream
Provides an input stream for reading requests from a client.
ServletOutputStream
Provides an output stream for writing requests to a client.
ServletException
Indicates a servlet error occurred.
Unavailable Exception
Indicates a servlet is unavailable
ServletRequestWrapper
Creates a ServletRequest adaptor wrapping request object
ServletResponseWrapper
Creates a ServletResponse adaptor wrapping request object
The above stated list are only important interfaces of package.


To Top