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 getInitParameterNames()
Returns an enumeration of strings representing the initialization parameter names for this servlet.
 o getServletConfig()
Returns the startup configuration information for this 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(ServletConfig)
Initializes the servlet.
 o log(String)
Logs the class name of the servlet and the given message to 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 getInitParameterNames
  public Enumeration getInitParameterNames()
Returns an enumeration of strings representing the initialization parameter names for this servlet.

 o log
  public void log(String msg)
Logs the class name of the servlet and the given message to 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(ServletConfig config) throws ServletException
Initializes the servlet. This is called automatically by the system when the servlet is first loaded.

Parameters:
config - servlet configuration information
Throws: ServletException
if a servlet exception has occurred
 o getServletConfig
  public ServletConfig getServletConfig()
Returns the startup configuration information for this servlet.

 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