| java.lang.Object org.apache.catalina.util.ProcessEnvironment org.apache.catalina.util.CGIProcessEnvironment
CGIProcessEnvironment | public class CGIProcessEnvironment extends ProcessEnvironment (Code) | | Encapsulates the CGI Process' environment and rules to derive
that environment from the servlet container and request information.
author: Martin Dengler [root@martindengler.com] version: $Revision: 1.3 $, $Date: 2001/08/14 18:50:10 $ since: Tomcat 4.0 |
Constructor Summary | |
public | CGIProcessEnvironment(HttpServletRequest req, ServletContext context) Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc. | public | CGIProcessEnvironment(HttpServletRequest req, ServletContext context, String cgiPathPrefix) Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc. | public | CGIProcessEnvironment(HttpServletRequest req, ServletContext context, int debug) Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc. | public | CGIProcessEnvironment(HttpServletRequest req, ServletContext context, String cgiPathPrefix, int debug) Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc. |
CGIProcessEnvironment | public CGIProcessEnvironment(HttpServletRequest req, ServletContext context)(Code) | | Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc. The cgi path prefix is initialized
to "" (the empty string).
Parameters: req - HttpServletRequest for information provided bythe Servlet API Parameters: context - ServletContext for information provided bythe Servlet API |
CGIProcessEnvironment | public CGIProcessEnvironment(HttpServletRequest req, ServletContext context, String cgiPathPrefix)(Code) | | Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc.
Parameters: req - HttpServletRequest for information provided bythe Servlet API Parameters: context - ServletContext for information provided bythe Servlet API Parameters: cgiPathPrefix - subdirectory of webAppRootDir below which theweb app's CGIs may be stored; can be null or "". |
CGIProcessEnvironment | public CGIProcessEnvironment(HttpServletRequest req, ServletContext context, int debug)(Code) | | Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc.
Parameters: req - HttpServletRequest for information provided bythe Servlet API Parameters: context - ServletContext for information provided bythe Servlet API Parameters: debug - int debug level (0 == none, 6 == lots) |
CGIProcessEnvironment | public CGIProcessEnvironment(HttpServletRequest req, ServletContext context, String cgiPathPrefix, int debug)(Code) | | Creates a ProcessEnvironment and derives the necessary environment,
working directory, command, etc.
Parameters: req - HttpServletRequest for information provided bythe Servlet API Parameters: context - ServletContext for information provided bythe Servlet API Parameters: cgiPathPrefix - subdirectory of webAppRootDir below which theweb app's CGIs may be stored; can be null or "". Parameters: debug - int debug level (0 == none, 6 == lots) |
deriveProcessEnvironment | protected boolean deriveProcessEnvironment(HttpServletRequest req)(Code) | | Constructs the CGI environment to be supplied to the invoked CGI
script; relies heavliy on Servlet API methods and findCGI
Parameters: HttpServletRequest - request associated with the CGI invokation true if environment was set OK, false if there was a problemand no environment was set |
findCGI | protected String[] findCGI(String pathInfo, String webAppRootDir, String contextPath, String servletPath, String cgiPathPrefix)(Code) | | Resolves core information about the cgi script. Example URI:
/servlet/cgigateway/dir1/realCGIscript/pathinfo1
- path = $CATALINA_HOME/mywebapp/dir1/realCGIscript
- scriptName = /servlet/cgigateway/dir1/realCGIscript
- cgiName = /dir1/realCGIscript
- name = realCGIscript
CGI search algorithm: search the real path below
<my-webapp-root> and find the first non-directory in
the getPathTranslated("/"), reading/searching from left-to-right.
The CGI search path will start at
webAppRootDir + File.separator + cgiPathPrefix (or webAppRootDir
alone if cgiPathPrefix is null).
cgiPathPrefix is usually set by the calling servlet to the servlet's
cgiPathPrefix init parameter
Parameters: pathInfo - String from HttpServletRequest.getPathInfo() Parameters: webAppRootDir - String from context.getRealPath("/") Parameters: contextPath - String as from HttpServletRequest.getContextPath() Parameters: servletPath - String as from HttpServletRequest.getServletPath() Parameters: cgiPathPrefix - subdirectory of webAppRootDir below which theweb app's CGIs may be stored; can be null. -
path - full file-system path to valid cgiscript, or null if no cgi was found -
scriptName - CGI variable SCRIPT_NAME; the fullURL path to valid cgi script ornull if no cgi was found -
cgiName - servlet pathInfo fragmentcorresponding to the cgi scriptitself, or null if not found -
name - simple name (no directories) ofthe cgi script, or null if no cgiwas found author: Martin Dengler [root@martindengler.com] since: Tomcat 4.0 |
getParameters | public Hashtable getParameters()(Code) | | Gets process' derived query parameters
process' query parameters |
toString | public String toString()(Code) | | Print important CGI environment information in an
easy-to-read HTML table
HTML string containing CGI environment info |
|
|