All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.Serve.servlet.GenericServlet

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

public abstract class GenericServlet
extends Object
implements Servlet
Convenience class for Servlet implementors.

This is an abstract object that implements the Servlet interface. Servlet has to be an interface so that things that must inherit from another object, such as RMI, can also be Servlets. However, most of the time a Servlet will not need to be anything else, and it will be somewhat more convenient to extend this class and just provide the service() routine.

This is taken from JavaSoft's Servlet API documentation.

Fetch the software.
Fetch the entire Acme package.

See Also:
Servlet

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()
Gets a hash table of the initialization parameters of the servlet.
 o getServletConfig()
Returns a servlet config object, which contains any initialization parameters and startup configuration 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)
Write information to the servlet log.
 o service(ServletRequest, ServletResponse)
Services a single request from the client.

Constructors

 o GenericServlet
 public GenericServlet()

Methods

 o getServletInfo
 public String getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.

 o init
 public void init() throws ServletException
Initializes the servlet. This is called by the system when the servlet is first loaded.

Throws: ServletException
when an exception has occurred
 o service
 public abstract void service(ServletRequest req,
                              ServletResponse res) throws ServletException, IOException
Services a single request from the client.

Note that the server only creates a single instance of your Servlet subclass, and calls the service() method of that one instance multiple times, possibly at the same time in different threads. This is somewhat unusual in the Java world. The implication is that any instance variables in your class behave more like class variables - they are shared among multiple concurrent calls. So, be careful.

Parameters:
req - the servlet request
req - the servlet response
Throws: ServletException
when a servlet exception has occurred
Throws: IOException
when an I/O exception has occurred
 o destroy
 public void destroy()
Destroys the servlet and cleans up whatever resources are being held. This is called by the system when the servlet is being destroyed.

 o init
 public void init(ServletConfig config) throws ServletException
Initializes the servlet. This is called by the system when the servlet is first loaded.

Parameters:
config - servlet initialization information
Throws: ServletException
when an exception has occurred
 o getServletConfig
 public ServletConfig getServletConfig()
Returns a servlet config object, which contains any initialization parameters and startup configuration for this servlet.

 o log
 public void log(String message)
Write information to the servlet log.

Parameters:
message - the message to log
 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()
Gets a hash table of the initialization parameters of the servlet.

Parameters:
name - the parameter name

All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs