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

Class sun.server.http.CgiServlet

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

public class CgiServlet
extends Servlet
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()
Initializes the CGI servlet.
 o sendResponse(String[], String[], ServletRequest, ServletResponse, boolean)
Execute the specified cgi script, parse its headers if necessary and pass it's response back to the client.
 o service(ServletRequest, ServletResponse)
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()
Initializes the CGI servlet.
Overrides:
init in class Servlet
 o service
  public void service(ServletRequest req,
                      ServletResponse res) throws 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 Servlet
 o sendResponse
  public void sendResponse(String command[],
                           String envp[],
                           ServletRequest req,
                           ServletResponse res,
                           boolean parseHeaders) throws IOException
Execute the specified cgi script, parse its headers if necessary 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
parseHeaders - whether the servlet should parse the headers returned by the script and generate a full header from them, or the servlet should let the cgi-script generate its own headers
 o getServletInfo
  public String getServletInfo()
Returns a string containing information about the author, version, and copyright of the servlet.
Overrides:
getServletInfo in class Servlet

All Packages  Class Hierarchy  This Package  Previous  Next  Index