All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface Acme.Serve.servlet.Servlet

public interface Servlet
The servlet interface.

Servlets are little Java programs that can be hooked into a server and run in response to requests.

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 GenericServlet.

This is taken from JavaSoft's Servlet API documentation.

Fetch the software.
Fetch the entire Acme package.

See Also:
GenericServlet, HttpServlet, SampleServlet, Serve

Method Index

 o destroy()
Destroys the servlet and cleans up whatever resources are being held.
 o getServletConfig()
Returns a servlet config object, which contains any initialization parameters and startup configuration for this servlet.
 o getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.
 o init(ServletConfig)
Initializes the servlet.
 o service(ServletRequest, ServletResponse)
Services a single request from the client.

Methods

 o init
 public abstract 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 abstract ServletConfig getServletConfig()
Returns a servlet config object, which contains any initialization parameters and startup configuration for this servlet.

 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 getServletInfo
 public abstract String getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.

 o destroy
 public abstract 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.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs