|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsunlabs.brazil.server.Request
sunlabs.brazil.servlet.BServletRequest (view source)
public class BServletRequest
This is a subclass of Request
that is used by
BrazilServlet
to map servlet style requests and responses
to and from Brazil style requests.
BServletSocket
,
BServletServerSocket
,
BrazilServlet
,
Request
Nested Class Summary | |
---|---|
static class |
BServletRequest.HttpOutputStream
An HttpOutputStream that is used by the Brazil Servlet
adaptor to add the web application
context path to the front of all response URI's so subsequent requests
will be mapped to the BrazilServlet 's context. |
Field Summary |
---|
Fields inherited from class sunlabs.brazil.server.Request |
---|
connectionHeader, headers, keepAlive, MAX_BLANKS, method, out, postData, props, protocol, query, responseHeaders, server, serverProps, serverProtocol, sock, startMillis, url, version |
Method Summary | |
---|---|
boolean |
getRequest()
Converts an HTTP request from the form encapsulated in a servlet request object to the form expected by Brazil handlers. |
void |
redirect(String url,
String body)
Responds to an HTTP request with a redirection reply, telling the client that the requested url has moved. |
String |
serverUrl()
Returns the server's fully-qualified base URL. |
void |
setStatus(int code)
Sets response code in the servlet response object. |
Methods inherited from class sunlabs.brazil.server.Request |
---|
addHeader, addHeader, addSharedProps, getProtocol, getQueryData, getQueryData, getRequestHeader, getReuseCount, getSocket, getStatus, log, log, removeSharedProps, replaceHeader, sendError, sendError, sendHeaders, sendResponse, sendResponse, sendResponse, sendResponse, sendResponse, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean getRequest() throws IOException
getRequest
in class Request
true
if the request was successfully read and
parsed, false
if the request was malformed.
IOException
- if there was an IOException reading from the socket. See
the socket documentation for a description of socket
exceptions.public void setStatus(int code)
setStatus
in class Request
code
- The HTTP status code, such as 200
or
404
. If < 0, the HTTP status code will
not be changed.Request.sendHeaders(int, String, int)
public String serverUrl()
If the HTTP request header "Host" is present, it specifies the hostname and port that will be used instead of the server's internal name for itself. Due to bugs in certain browsers, when using the server's internal name, the port number will be elided if it is 80.
serverUrl
in class Request
public void redirect(String url, String body) throws IOException
Request
redirect
in class Request
url
- The URL the client should have requested. This URL may be
fully-qualified (in the form "http://....") or host-relative
(in the form "/...").body
- The body of the redirect response, or null
to
send a hardcoded message.
IOException
|
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 |