php.java.servlet.fastcgi
Class FastCGIServlet.CGIEnvironment

java.lang.Object
  extended by php.java.servlet.CGIServlet.CGIEnvironment
      extended by php.java.servlet.fastcgi.FastCGIServlet.CGIEnvironment
Direct Known Subclasses:
PhpCGIServlet.CGIEnvironment
Enclosing class:
FastCGIServlet

protected class FastCGIServlet.CGIEnvironment
extends CGIServlet.CGIEnvironment


Field Summary
 IContextFactory ctx
           
protected static java.lang.String empty_string
           
 
Fields inherited from class php.java.servlet.CGIServlet.CGIEnvironment
command, context, contextPath, environment, pathInfo, servletPath, webAppRootDir, workingDirectory
 
Constructor Summary
protected FastCGIServlet.CGIEnvironment(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.ServletContext context)
           
 
Method Summary
protected  java.lang.String[] findCGI(java.lang.String pathInfo, java.lang.String webAppRootDir, java.lang.String contextPath, java.lang.String servletPath, java.lang.String cgiPathPrefix)
          Resolves core information about the cgi script.
 
Methods inherited from class php.java.servlet.CGIServlet.CGIEnvironment
blanksToString, init, nullsToBlanks, nullsToString, setCGIEnvironment, setPathInfo, setupFromContext, setupFromRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

public IContextFactory ctx

empty_string

protected static final java.lang.String empty_string
See Also:
Constant Field Values
Constructor Detail

FastCGIServlet.CGIEnvironment

protected FastCGIServlet.CGIEnvironment(javax.servlet.http.HttpServletRequest req,
                                        javax.servlet.http.HttpServletResponse res,
                                        javax.servlet.ServletContext context)
Method Detail

findCGI

protected java.lang.String[] findCGI(java.lang.String pathInfo,
                                     java.lang.String webAppRootDir,
                                     java.lang.String contextPath,
                                     java.lang.String servletPath,
                                     java.lang.String cgiPathPrefix)
Description copied from class: CGIServlet.CGIEnvironment
Resolves core information about the cgi script.

Example URI:

 /servlet/cgigateway/dir1/realCGIscript/pathinfo1 

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 defined by setting this servlet's cgiPathPrefix init parameter

Overrides:
findCGI in class CGIServlet.CGIEnvironment
Parameters:
pathInfo - String from HttpServletRequest.getPathInfo()
webAppRootDir - String from context.getRealPath("/")
contextPath - String as from HttpServletRequest.getContextPath()
servletPath - String as from HttpServletRequest.getServletPath()
cgiPathPrefix - subdirectory of webAppRootDir below which the web app's CGIs may be stored; can be null. The CGI search path will start at webAppRootDir + File.separator + cgiPathPrefix (or webAppRootDir alone if cgiPathPrefix is null). cgiPathPrefix is defined by setting the servlet's cgiPathPrefix init parameter.
Returns:
  • path - full file-system path to valid cgi script, or null if no cgi was found
  • scriptName - CGI variable SCRIPT_NAME; the full URL path to valid cgi script or null if no cgi was found
  • cgiName - servlet pathInfo fragment corresponding to the cgi script itself, or null if not found
  • name - simple name (no directories) of the cgi script, or null if no cgi was found
author Martin Dengler [root@martindengler.com]