|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgnu.kawa.servlet.HttpRequestContext
gnu.kawa.servlet.KawaHttpHandler.Context
public static class KawaHttpHandler.Context
| Field Summary |
|---|
| Fields inherited from class gnu.kawa.servlet.HttpRequestContext |
|---|
HTTP_NOT_FOUND, HTTP_OK, importServletDefinitions, instance, statusCode, statusReasonPhrase |
| Constructor Summary | |
|---|---|
KawaHttpHandler.Context()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Get attribute from the server context. |
java.lang.String |
getContextPath()
Returns the context path, relative to the server root. |
java.net.InetAddress |
getLocalHost()
|
int |
getLocalPort()
|
java.net.InetSocketAddress |
getLocalSocketAddress()
|
java.lang.String |
getPathTranslated()
|
java.lang.String |
getQueryString()
|
java.net.InetAddress |
getRemoteHost()
|
java.lang.String |
getRemoteIPAddress()
|
int |
getRemotePort()
|
java.net.InetSocketAddress |
getRemoteSocketAddress()
|
java.lang.String |
getRequestHeader(java.lang.String name)
|
com.sun.net.httpserver.Headers |
getRequestHeaders()
|
java.util.List<java.lang.String> |
getRequestHeaders(java.lang.String name)
|
java.lang.String |
getRequestMethod()
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getRequestParameters()
|
java.lang.String |
getRequestScheme()
|
java.io.InputStream |
getRequestStream()
|
java.net.URI |
getRequestURI()
|
java.net.URL |
getResourceURL(java.lang.String path)
Returns the URL of a resource. |
java.io.OutputStream |
getResponseStream()
Return an OutputStream for the result body. |
void |
log(java.lang.String message)
|
void |
log(java.lang.String message,
java.lang.Throwable ex)
|
static void |
parsePostParameters(com.sun.net.httpserver.HttpExchange exchange,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
|
static void |
parseQuery(java.lang.String query,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
|
boolean |
reset(boolean headersAlso)
Try to reset (delete) any response generated so far. |
void |
sendResponseHeaders(int reasonCode,
java.lang.String reasonPhrase,
long responseLength)
Send headers. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set attribute in the server context. |
void |
setContentType(java.lang.String type)
|
void |
setExchange(com.sun.net.httpserver.HttpExchange exchange,
KawaHttpHandler httpHandler)
|
void |
setResponseHeader(java.lang.String name,
java.lang.String value)
|
| Methods inherited from class gnu.kawa.servlet.HttpRequestContext |
|---|
getConsumer, getInstance, getInstance, getLocalIPAddress, getLocalPath, getRequestBodyChars, getRequestParameter, getRequestPath, getRequestPort, getRequestURLBuffer, getScriptPath, normalizeToContext, sendNotFound, setInstance, setScriptAndLocalPath |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KawaHttpHandler.Context()
| Method Detail |
|---|
public void setExchange(com.sun.net.httpserver.HttpExchange exchange,
KawaHttpHandler httpHandler)
public java.net.URL getResourceURL(java.lang.String path)
HttpRequestContext'/' it is relative to the context path.
getResourceURL in class HttpRequestContextpublic java.io.InputStream getRequestStream()
getRequestStream in class HttpRequestContextpublic java.io.OutputStream getResponseStream()
HttpRequestContext
getResponseStream in class HttpRequestContextpublic boolean reset(boolean headersAlso)
HttpRequestContext
reset in class HttpRequestContextheadersAlso - if response headers should also be reset.
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRequestParameters()
getRequestParameters in class HttpRequestContextpublic java.lang.String getRequestHeader(java.lang.String name)
getRequestHeader in class HttpRequestContextpublic java.util.List<java.lang.String> getRequestHeaders(java.lang.String name)
getRequestHeaders in class HttpRequestContextpublic com.sun.net.httpserver.Headers getRequestHeaders()
getRequestHeaders in class HttpRequestContextpublic java.net.URI getRequestURI()
getRequestURI in class HttpRequestContextpublic java.lang.String getContextPath()
HttpRequestContextHttpRequestContext.getRequestPath().
Like ServletContext#getContextPath, but ends with a '/'.
The string getRequestURI() is the same as the concatenation of
getContextPath(), getScriptPath(), and {code getLocationPath()}.
getContextPath in class HttpRequestContextpublic java.lang.String getPathTranslated()
getPathTranslated in class HttpRequestContextpublic java.lang.String getRequestScheme()
getRequestScheme in class HttpRequestContextpublic java.net.InetSocketAddress getLocalSocketAddress()
getLocalSocketAddress in class HttpRequestContextpublic java.net.InetAddress getLocalHost()
getLocalHost in class HttpRequestContextpublic int getLocalPort()
getLocalPort in class HttpRequestContextpublic java.net.InetSocketAddress getRemoteSocketAddress()
getRemoteSocketAddress in class HttpRequestContextpublic java.lang.String getRemoteIPAddress()
getRemoteIPAddress in class HttpRequestContextpublic java.net.InetAddress getRemoteHost()
getRemoteHost in class HttpRequestContextpublic int getRemotePort()
getRemotePort in class HttpRequestContextpublic java.lang.String getRequestMethod()
getRequestMethod in class HttpRequestContextpublic java.lang.String getQueryString()
getQueryString in class HttpRequestContext
public void setResponseHeader(java.lang.String name,
java.lang.String value)
setResponseHeader in class HttpRequestContextpublic void setContentType(java.lang.String type)
setContentType in class HttpRequestContextpublic java.lang.Object getAttribute(java.lang.String name)
HttpRequestContext
getAttribute in class HttpRequestContext
public void setAttribute(java.lang.String name,
java.lang.Object value)
HttpRequestContext
setAttribute in class HttpRequestContext
public void sendResponseHeaders(int reasonCode,
java.lang.String reasonPhrase,
long responseLength)
throws java.io.IOException
HttpRequestContext
sendResponseHeaders in class HttpRequestContextreasonCode - response code - e.g. 200 for OK.reasonPhrase - response string - e.g. "OK" or "Not Found".responseLength - response length in bytes, or -1 (unspecified).
Note this is different from HttpExchange.sendResponseHeaders.
This method must be called before getResponseStream.
Implementations should set statusCode to STATUS_SENT.
java.io.IOException
public static void parseQuery(java.lang.String query,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static void parsePostParameters(com.sun.net.httpserver.HttpExchange exchange,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
throws java.io.IOException
java.io.IOExceptionpublic void log(java.lang.String message)
log in class HttpRequestContext
public void log(java.lang.String message,
java.lang.Throwable ex)
log in class HttpRequestContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||