| java.lang.Object sunlabs.brazil.handler.ReflectHandler
ReflectHandler | public class ReflectHandler implements Handler(Code) | | Handler for reflecting query data back to the client.
This is the example handler to demonstrate how a typical
handler is witten. If query data is present, it is formatted into
an HTML table, and displayed to the user.
author: Stephen Uhler version: 1.9, 00/05/31 |
Method Summary | |
public static String | formatTable(Dictionary data, String caption) Turn a hash table into html format. | public boolean | init(Server server, String prefix) Initialize the handler.
Handler objects are created by the server using newInstance().
The init method is called first, and exactly one for each instance,
and may be used for one-time initializations.
This handler doesn't require any.
Parameters: server - A reference to the server. Parameters: prefix - A string identifying this instance of thehandler. | public boolean | respond(Request request) Dispatch and handle the request.
This version justs reflects the HTTP header information.
It is commonly placed downstream of the
CgiHandler to allow HTML forms to be tested before
the cgi script is written.
Parameters: request - The request object contains all of the informationabout the request, as well as methods to manipulateit. |
formatTable | public static String formatTable(Dictionary data, String caption)(Code) | | Turn a hash table into html format. This is a static method
so it may be used in other handlers.
Parameters: table - The table to format The html fragment |
init | public boolean init(Server server, String prefix)(Code) | | Initialize the handler.
Handler objects are created by the server using newInstance().
The init method is called first, and exactly one for each instance,
and may be used for one-time initializations.
This handler doesn't require any.
Parameters: server - A reference to the server. Parameters: prefix - A string identifying this instance of thehandler. It is used by thesunlabs.brazil.server.ChainHandler toprovide the prefix to be prepended onto eachproperty intended for this handler. true Only if the handler is successfully initialized. |
respond | public boolean respond(Request request) throws IOException(Code) | | Dispatch and handle the request.
This version justs reflects the HTTP header information.
It is commonly placed downstream of the
CgiHandler to allow HTML forms to be tested before
the cgi script is written.
Parameters: request - The request object contains all of the informationabout the request, as well as methods to manipulateit. Although multiple threads may call this methodconnurrently, each will have its own request object. |
|
|