Class sun.server.http.CgiServlet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.http.CgiServlet

java.lang.Object
   |
   +----java.servlet.GenericServlet
           |
           +----java.servlet.http.HttpServlet
                   |
                   +----sun.server.http.CgiServlet

public class CgiServlet
extends HttpServlet
A class used by Java http server to run cgi-scripts. Implements the CGI/1.1 interface. Eventually we would like all the cgi-scripts to be replaced by servlets. This class is provided for people who want to run existing cgi programs.

Constructor Index

 o CgiServlet()
Creates a new CGI servlet.

Method Index

 o getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.
 o init(ServletStub)
Initializes the CGI servlet.
 o sendResponse(String[], String[], HttpServletRequest, HttpServletResponse)
Execute the specified cgi script, parse its headers, and pass it's response back to the client.
 o service(HttpServletRequest, HttpServletResponse)
Services a single CGI-BIN request from the client.

Constructors

 o CgiServlet
  public CgiServlet()
Creates a new CGI servlet.

Methods

 o init
  public void init(ServletStub stub) throws ServletException
Initializes the CGI servlet.
Overrides:
init in class GenericServlet
 o service
  public void service(HttpServletRequest req,
                      HttpServletResponse res) throws ServletException, IOException
Services a single CGI-BIN request from the client.
Parameters:
req - the HTTP request
req - the HTTP response
Throws: IOException
If an I/O error has occurred.
Overrides:
service in class HttpServlet
 o sendResponse
  public void sendResponse(String command[],
                           String envp[],
                           HttpServletRequest req,
                           HttpServletResponse res) throws IOException
Execute the specified cgi script, parse its headers, and pass it's response back to the client.
Parameters:
command - the cgi script to execute
envp - the environment variables to give the cgi script
req - the HTTP request
res - teh HTTP response
 o getServletInfo
  public String getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.
Overrides:
getServletInfo in class GenericServlet

All Packages  Class Hierarchy  This Package  Previous  Next  Index