Class java.servlet.GenericServlet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.servlet.GenericServlet

java.lang.Object
   |
   +----java.servlet.GenericServlet

public class GenericServlet
extends Object
implements Servlet
Generic servlet base class. This is a convenience class so that generic servlets can share common implementation. Servlet writers inherit from this class and just implement the service method.

Constructor Index

 o GenericServlet()

Method Index

 o destroy()
Destroys the servlet and cleans up whatever resources are being held.
 o getInitParameter(String)
Gets an initialization parameter of the servlet.
 o getInitParameters()
Returns a hashtable of the initialization parameters of the servlet.
 o getServletContext()
Returns the servlet context.
 o getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.
 o init()
Initializes the servlet.
 o init(ServletStub)
Initializes the servlet.
 o log(String)
Logs a message into the servlet log file.
 o service(ServletRequest, ServletResponse)
Services a single request from the client.

Constructors

 o GenericServlet
  public GenericServlet()

Methods

 o getServletContext
  public ServletContext getServletContext()
Returns the servlet context. The servlet context lets a servlet access the environment of the server in which it is running.
 o getInitParameter
  public String getInitParameter(String name)
Gets an initialization parameter of the servlet.
Parameters:
name - the parameter name
 o getInitParameters
  public Hashtable getInitParameters()
Returns a hashtable of the initialization parameters of the servlet.
 o log
  public void log(String msg)
Logs a message into the servlet log file.
Parameters:
msg - the message string
 o getServletInfo
  public String getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.
 o init
  public void init(ServletStub stub) throws ServletException
Initializes the servlet. This is called automatically by the system when the servlet is first loaded.
Parameters:
stub - servlet initialization information
Throws: ServletException
if a servlet exception has occurred
 o init
  public void init() throws ServletException
Initializes the servlet. This is called automatically by the system when the servlet is first loaded.
Throws: ServletException
if a servlet exception has occurred
 o service
  public abstract void service(ServletRequest req,
                               ServletResponse res) throws ServletException, IOException
Services a single request from the client.
Parameters:
req - the servlet request
req - the servlet response
Throws: ServletException
if a servlet exception has occurred
Throws: IOException
if an I/O exception has occurred
 o destroy
  public void destroy()
Destroys the servlet and cleans up whatever resources are being held.

All Packages  Class Hierarchy  This Package  Previous  Next  Index