|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsunlabs.brazil.handler.CgiHandler (view source)
public class CgiHandler
Handler for implementing cgi/1.1 interface.
This implementation allows either suffix matching (e.g. .cgi) to identify
cgi scripts, or prefix matching (e.g. /bgi-bin). Defaults to "/".
All output from the cgi script is buffered (e.g. chunked encoding is
not supported).
NOTE: in versions of Java prior to release 1.3, the ability to set
a working directory when running an external process is missing.
This handler automatically checks for this ability and sets the
proper working directory, but only if the underlying VM supports it.
The following request properties are used:
CONFIG_name
, where name is the
property key, in upper case, with the prefix removed.
This allows cgi scripts to be customized in the server's
configuration file.
Constructor Summary | |
---|---|
CgiHandler()
|
Method Summary | |
---|---|
boolean |
init(Server server,
String prefix)
One time initialization. |
boolean |
respond(Request request)
Dispatch and handle the CGI request. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CgiHandler()
Method Detail |
---|
public boolean init(Server server, String prefix)
respond(Request)
to allow
upstream handlers to modify the parameters.
init
in interface Handler
server
- The HTTP server that created this Handler
.
Typical Handler
s will use Server.props
to obtain run-time configuration information.prefix
- The handlers name.
The string this Handler
may prepend to all
of the keys that it uses to extract configuration information
from Server.props
. This is set (by the Server
and ChainHandler
) to help avoid configuration parameter
namespace collisions.
true
if this Handler
initialized
successfully, false
otherwise. If
false
is returned, this Handler
should not be used.public boolean respond(Request request)
Input parameters examined in the request properties:
respond
in interface Handler
request
- The Request
object that represents the HTTP
request.
true
if the request was handled. A request was
handled if a response was supplied to the client, typically
by calling Request.sendResponse()
or
Request.sendError
.
|
Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |