|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ka2ddo.yaac.webserver.PathHandler
public abstract class PathHandler
This is the generic web page generator class which should be subclassed to produce a particular page.
| Field Summary | |
|---|---|
protected HttpServer |
httpServer
Reference to HttpServer instance that uses invocations of this PathHandler instance. |
static java.lang.String |
TEXT_HTML_CHARSET_UTF_8
Predefined constant Content-Type string for HTML. |
| Constructor Summary | |
|---|---|
PathHandler()
|
|
| Method Summary | |
|---|---|
protected static void |
escPrint(java.io.PrintWriter pw,
java.lang.String text)
This method prints a String to the output PrintWriter, doing HTML escapes for any reserved characters. |
HttpServer |
getHttpServer()
Get the HttpServer instance associated with this PageHandler. |
abstract java.lang.String |
processPage(HttpConnectionThread hct,
java.util.LinkedHashMap<java.lang.String,java.lang.String> requestHeaders,
java.io.DataInputStream in,
java.io.OutputStream out,
java.lang.String path)
Given an inbound HTTP request, generate a page using its parameters. |
void |
setHttpServer(HttpServer httpServer)
Set the HttpServer instance associated with this PageHandler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TEXT_HTML_CHARSET_UTF_8
protected HttpServer httpServer
| Constructor Detail |
|---|
public PathHandler()
| Method Detail |
|---|
protected static void escPrint(java.io.PrintWriter pw,
java.lang.String text)
pw - PrintWriter to receive the escaped texttext - String to output with escapes
public abstract java.lang.String processPage(HttpConnectionThread hct,
java.util.LinkedHashMap<java.lang.String,java.lang.String> requestHeaders,
java.io.DataInputStream in,
java.io.OutputStream out,
java.lang.String path)
throws java.io.IOException
hct - HttpConnectionThread issuing the callrequestHeaders - the HTTP request headers the browser sentin - DataInputStream for reading the body of the HTTP requestout - OutputStream to write the generated page topath - the remainder of the URL following the prefix identifying this particular page, in case the user is providing parameters to the page
java.io.IOException - if the page could not be generated for some reasonpublic HttpServer getHttpServer()
public void setHttpServer(HttpServer httpServer)
httpServer - HttpServer instance to associate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||