<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2) on Sat Sep 25 10:14:03 EDT 2004 -->
<TITLE>
CGIServlet (Catalina Internal API Documentation)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.catalina.servlets.CGIServlet class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="CGIServlet (Catalina Internal API Documentation)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/apache/catalina/servlets/CGIServlet.CGIEnvironment.html" title="class in org.apache.catalina.servlets"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="CGIServlet.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.catalina.servlets</FONT>
<BR>
Class CGIServlet</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by">javax.servlet.GenericServlet
      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by">javax.servlet.http.HttpServlet
          <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.catalina.servlets.CGIServlet</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig</DD>
</DL>
<HR>
<DL>
<DT>public class <B>CGIServlet</B><DT>extends javax.servlet.http.HttpServlet</DL>

<P>
CGI-invoking servlet for web applications, used to execute scripts which
  comply to the Common Gateway Interface (CGI) specification and are named
  in the path-info used to invoke this servlet.

 <p>
 <i>Note: This code compiles and even works for simple CGI cases.
          Exhaustive testing has not been done.  Please consider it beta
          quality.  Feedback is appreciated to the author (see below).</i>
 </p>
 <p>

 <b>Example</b>:<br>
 If an instance of this servlet was mapped (using
       <code>&lt;web-app&gt;/WEB-INF/web.xml</code>) to:
 </p>
 <p>
 <code>
 &lt;web-app&gt;/cgi-bin/*
 </code>
 </p>
 <p>
 then the following request:
 </p>
 <p>
 <code>
 http://localhost:8080/&lt;web-app&gt;/cgi-bin/dir1/script/pathinfo1
 </code>
 </p>
 <p>
 would result in the execution of the script
 </p>
 <p>
 <code>
 &lt;web-app-root&gt;/WEB-INF/cgi/dir1/script
 </code>
 </p>
 <p>
 with the script's <code>PATH_INFO</code> set to <code>/pathinfo1</code>.
 </p>
 <p>
 Recommendation:  House all your CGI scripts under
 <code>&lt;webapp&gt;/WEB-INF/cgi</code>.  This will ensure that you do not
 accidentally expose your cgi scripts' code to the outside world and that
 your cgis will be cleanly ensconced underneath the WEB-INF (i.e.,
 non-content) area.
 </p>
 <p>
 The default CGI location is mentioned above.  You have the flexibility to
 put CGIs wherever you want, however:
 </p>
 <p>
   The CGI search path will start at
   webAppRootDir + File.separator + cgiPathPrefix
   (or webAppRootDir alone if cgiPathPrefix is
   null).
 </p>
 <p>
   cgiPathPrefix is defined by setting
   this servlet's cgiPathPrefix init parameter
 </p>

 <p>

 <B>CGI Specification</B>:<br> derived from
 <a href="http://cgi-spec.golux.com">http://cgi-spec.golux.com</a>.
 A work-in-progress & expired Internet Draft.  Note no actual RFC describing
 the CGI specification exists.  Where the behavior of this servlet differs
 from the specification cited above, it is either documented here, a bug,
 or an instance where the specification cited differs from Best
 Community Practice (BCP).
 Such instances should be well-documented here.  Please email the
 <a href="mailto:tomcat-dev@jakarta.apache.org">Jakarta Tomcat group [tomcat-dev@jakarta.apache.org]</a>
 with amendments.

 </p>
 <p>

 <b>Canonical metavariables</b>:<br>
 The CGI specification defines the following canonical metavariables:
 <br>
 [excerpt from CGI specification]
 <PRE>
  AUTH_TYPE
  CONTENT_LENGTH
  CONTENT_TYPE
  GATEWAY_INTERFACE
  PATH_INFO
  PATH_TRANSLATED
  QUERY_STRING
  REMOTE_ADDR
  REMOTE_HOST
  REMOTE_IDENT
  REMOTE_USER
  REQUEST_METHOD
  SCRIPT_NAME
  SERVER_NAME
  SERVER_PORT
  SERVER_PROTOCOL
  SERVER_SOFTWARE
 </PRE>
 <p>
 Metavariables with names beginning with the protocol name (<EM>e.g.</EM>,
 "HTTP_ACCEPT") are also canonical in their description of request header
 fields.  The number and meaning of these fields may change independently
 of this specification.  (See also section 6.1.5 [of the CGI specification].)
 </p>
 [end excerpt]

 </p>
 <h2> Implementation notes</h2>
 <p>

 <b>standard input handling</b>: If your script accepts standard input,
 then the client must start sending input within a certain timeout period,
 otherwise the servlet will assume no input is coming and carry on running
 the script.  The script's the standard input will be closed and handling of
 any further input from the client is undefined.  Most likely it will be
 ignored.  If this behavior becomes undesirable, then this servlet needs
 to be enhanced to handle threading of the spawned process' stdin, stdout,
 and stderr (which should not be too hard).
 <br>
 If you find your cgi scripts are timing out receiving input, you can set
 the init parameter <code></code> of your webapps' cgi-handling servlet
 to be
 </p>
 <p>

 <b>Metavariable Values</b>: According to the CGI specificion,
 implementations may choose to represent both null or missing values in an
 implementation-specific manner, but must define that manner.  This
 implementation chooses to always define all required metavariables, but
 set the value to "" for all metavariables whose value is either null or
 undefined.  PATH_TRANSLATED is the sole exception to this rule, as per the
 CGI Specification.

 </p>
 <p>

 <b>NPH --  Non-parsed-header implementation</b>:  This implementation does
 not support the CGI NPH concept, whereby server ensures that the data
 supplied to the script are preceisely as supplied by the client and
 unaltered by the server.
 </p>
 <p>
 The function of a servlet container (including Tomcat) is specifically
 designed to parse and possible alter CGI-specific variables, and as
 such makes NPH functionality difficult to support.
 </p>
 <p>
 The CGI specification states that compliant servers MAY support NPH output.
 It does not state servers MUST support NPH output to be unconditionally
 compliant.  Thus, this implementation maintains unconditional compliance
 with the specification though NPH support is not present.
 </p>
 <p>

 The CGI specification is located at
 <a href="http://cgi-spec.golux.com">http://cgi-spec.golux.com</a>.

 </p>
 <p>
 <h3>TODO:</h3>
 <ul>
 <li> Support for setting headers (for example, Location headers don't work)
 <li> Support for collapsing multiple header lines (per RFC 2616)
 <li> Ensure handling of POST method does not interfere with 2.3 Filters
 <li> Refactor some debug code out of core
 <li> Ensure header handling preserves encoding
 <li> Possibly rewrite CGIRunner.run()?
 <li> Possibly refactor CGIRunner and CGIEnvironment as non-inner classes?
 <li> Document handling of cgi stdin when there is no stdin
 <li> Revisit IOException handling in CGIRunner.run()
 <li> Better documentation
 <li> Confirm use of ServletInputStream.available() in CGIRunner.run() is
      not needed
 <li> Make checking for "." and ".." in servlet & cgi PATH_INFO less
      draconian
 <li> [add more to this TODO list]
 </ul>
 </p>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>Tomcat 4.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Revision: 1.27 $, $Date: 2004/08/26 21:38:13 $</DD>
<DT><B>Author:</B></DT>
  <DD>Martin T Dengler [root@martindengler.com], Amy Roh</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#org.apache.catalina.servlets.CGIServlet">Serialized Form</A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.CGIEnvironment.html" title="class in org.apache.catalina.servlets">CGIServlet.CGIEnvironment</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encapsulates the CGI environment and rules to derive
 that environment from the servlet container and request information.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.CGIRunner.html" title="class in org.apache.catalina.servlets">CGIServlet.CGIRunner</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encapsulates the knowledge of how to run a CGI script, given the
 script's desired environment and (optionally) input/output streams

 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.HTTPHeaderInputStream.html" title="class in org.apache.catalina.servlets">CGIServlet.HTTPHeaderInputStream</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is an input stream specifically for reading HTTP headers.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.NameValuePair.html" title="class in org.apache.catalina.servlets">CGIServlet.NameValuePair</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is a simple class for storing name-value pairs.</TD>
</TR>
</TABLE>
&nbsp;
<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.html#CGIServlet()">CGIServlet</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.html#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doGet</A></B>(javax.servlet.http.HttpServletRequest&nbsp;req,
      javax.servlet.http.HttpServletResponse&nbsp;res)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provides CGI Gateway service</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.html#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doPost</A></B>(javax.servlet.http.HttpServletRequest&nbsp;req,
       javax.servlet.http.HttpServletResponse&nbsp;res)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provides CGI Gateway service -- delegates to <code>doGet</code></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.html#init(javax.servlet.ServletConfig)">init</A></B>(javax.servlet.ServletConfig&nbsp;config)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets instance variables.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;args)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For future testing use only; does nothing right now</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/catalina/servlets/CGIServlet.html#printServletEnvironment(javax.servlet.ServletOutputStream, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">printServletEnvironment</A></B>(javax.servlet.ServletOutputStream&nbsp;out,
                        javax.servlet.http.HttpServletRequest&nbsp;req,
                        javax.servlet.http.HttpServletResponse&nbsp;res)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prints out important Servlet API and container information

 </TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.servlet.http.HttpServlet"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.servlet.http.HttpServlet</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.servlet.GenericServlet"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.servlet.GenericServlet</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="CGIServlet()"><!-- --></A><H3>
CGIServlet</H3>
<PRE>
public <B>CGIServlet</B>()</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="init(javax.servlet.ServletConfig)"><!-- --></A><H3>
init</H3>
<PRE>
public void <B>init</B>(javax.servlet.ServletConfig&nbsp;config)
          throws javax.servlet.ServletException</PRE>
<DL>
<DD>Sets instance variables.
 <P>
 Modified from Craig R. McClanahan's InvokerServlet
 </P>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>config</CODE> - a <code>ServletConfig</code> object
                                  containing the servlet's
                                  configuration and initialization
                                  parameters
<DT><B>Throws:</B>
<DD><CODE>javax.servlet.ServletException</CODE> - if an exception has occurred that
                                  interferes with the servlet's normal
                                  operation</DL>
</DD>
</DL>
<HR>

<A NAME="printServletEnvironment(javax.servlet.ServletOutputStream, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
printServletEnvironment</H3>
<PRE>
protected void <B>printServletEnvironment</B>(javax.servlet.ServletOutputStream&nbsp;out,
                                       javax.servlet.http.HttpServletRequest&nbsp;req,
                                       javax.servlet.http.HttpServletResponse&nbsp;res)
                                throws java.io.IOException</PRE>
<DL>
<DD>Prints out important Servlet API and container information

 <p>
 Copied from SnoopAllServlet by Craig R. McClanahan
 </p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>out</CODE> - ServletOutputStream as target of the information<DD><CODE>req</CODE> - HttpServletRequest object used as source of information<DD><CODE>res</CODE> - HttpServletResponse object currently not used but could
                provide future information
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - if a write operation exception occurs</DL>
</DD>
</DL>
<HR>

<A NAME="doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
doPost</H3>
<PRE>
protected void <B>doPost</B>(javax.servlet.http.HttpServletRequest&nbsp;req,
                      javax.servlet.http.HttpServletResponse&nbsp;res)
               throws java.io.IOException,
                      javax.servlet.ServletException</PRE>
<DL>
<DD>Provides CGI Gateway service -- delegates to <code>doGet</code>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>req</CODE> - HttpServletRequest passed in by servlet container<DD><CODE>res</CODE> - HttpServletResponse passed in by servlet container
<DT><B>Throws:</B>
<DD><CODE>javax.servlet.ServletException</CODE> - if a servlet-specific exception occurs
<DD><CODE>java.io.IOException</CODE> - if a read/write exception occurs<DT><B>See Also:</B><DD><CODE>HttpServlet</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
doGet</H3>
<PRE>
protected void <B>doGet</B>(javax.servlet.http.HttpServletRequest&nbsp;req,
                     javax.servlet.http.HttpServletResponse&nbsp;res)
              throws javax.servlet.ServletException,
                     java.io.IOException</PRE>
<DL>
<DD>Provides CGI Gateway service
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>req</CODE> - HttpServletRequest passed in by servlet container<DD><CODE>res</CODE> - HttpServletResponse passed in by servlet container
<DT><B>Throws:</B>
<DD><CODE>javax.servlet.ServletException</CODE> - if a servlet-specific exception occurs
<DD><CODE>java.io.IOException</CODE> - if a read/write exception occurs<DT><B>See Also:</B><DD><CODE>HttpServlet</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main</H3>
<PRE>
public static void <B>main</B>(java.lang.String[]&nbsp;args)</PRE>
<DL>
<DD>For future testing use only; does nothing right now
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/apache/catalina/servlets/CGIServlet.CGIEnvironment.html" title="class in org.apache.catalina.servlets"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="CGIServlet.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright  2000-2002 Apache Software Foundation.  All Rights Reserved.
</BODY>
</HTML>
