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
-
GenericServlet()
-
-
destroy()
- Destroys the servlet and cleans up whatever resources are being held.
-
getInitParameter(String)
- Gets an initialization parameter of the servlet.
-
getInitParameterNames()
- Gets a hash table of the initialization parameters of the servlet.
-
getServletConfig()
- Returns a servlet config object, which contains any initialization
parameters and startup configuration for this servlet.
-
getServletContext()
- Returns the servlet context.
-
getServletInfo()
- Returns a string containing information about the author, version, and
copyright of the servlet.
-
init()
- Initializes the servlet.
-
init(ServletConfig)
- Initializes the servlet.
-
log(String)
- Write information to the servlet log.
-
service(ServletRequest, ServletResponse)
- Services a single request from the client.
GenericServlet
public GenericServlet()
getServletInfo
public String getServletInfo()
- Returns a string containing information about the author, version, and
copyright of the servlet.
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
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
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.
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
getServletConfig
public ServletConfig getServletConfig()
- Returns a servlet config object, which contains any initialization
parameters and startup configuration for this servlet.
log
public void log(String message)
- Write information to the servlet log.
- Parameters:
- message - the message to log
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.
getInitParameter
public String getInitParameter(String name)
- Gets an initialization parameter of the servlet.
- Parameters:
- name - the parameter name
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