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.
-
GenericServlet()
-
-
destroy()
- Destroys the servlet and cleans up whatever resources are being
held.
-
getInitParameter(String)
- Gets an initialization parameter of the servlet.
-
getInitParameters()
- Returns a hashtable of the initialization parameters of the 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(ServletStub)
- Initializes the servlet.
-
log(String)
- Logs a message into the servlet log file.
-
service(ServletRequest, ServletResponse)
- Services a single request from the client.
GenericServlet
public GenericServlet()
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
getInitParameters
public Hashtable getInitParameters()
- Returns a hashtable of the initialization parameters of the servlet.
log
public void log(String msg)
- Logs a message into the servlet log file.
- Parameters:
- msg - the message string
getServletInfo
public String getServletInfo()
- Returns a string containing information about the author, version,
and copyright of the servlet.
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
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
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
destroy
public void destroy()
- Destroys the servlet and cleans up whatever resources are being
held.
All Packages Class Hierarchy This Package Previous Next Index