| |
|
| java.lang.Object org.apache.openejb.server.httpd.HttpResponseImpl
HttpResponseImpl | public class HttpResponseImpl implements HttpResponse(Code) | | This class takes care of HTTP Responses. It sends data back to the browser.
|
CRLF | final public static String CRLF(Code) | | a line feed character
|
HTTP_VERSION | final public static String HTTP_VERSION(Code) | | the HTTP version
|
server | public static String server(Code) | | the server to send data from
|
HttpResponseImpl | protected HttpResponseImpl()(Code) | | creates a new instance of HttpResponseImpl with default values
|
HttpResponseImpl | protected HttpResponseImpl(int code, String responseString, String contentType)(Code) | | Creates a new HttpResponseImpl with user provided parameters
Parameters: code - the HTTP Response code, see http://www.ietf.org/rfc/rfc2616.txtfor these codes Parameters: responseString - the response string to be sent back Parameters: contentType - the content type to be sent back |
createError | protected static HttpResponseImpl createError(String message)(Code) | | This could be improved at some day in the future
to also include a stack trace of the exceptions
Parameters: message - the error message to be sent the HttpResponseImpl that this error belongs to |
createError | protected static HttpResponseImpl createError(String message, Throwable t)(Code) | | creates an error with user defined variables
Parameters: message - the message of the error Parameters: t - a Throwable to print a stack trace to the HttpResponseImpl that this error belongs to |
createForbidden | protected static HttpResponseImpl createForbidden(String ip)(Code) | | Creates a forbidden response to be sent to the browser using IP authentication
Parameters: ip - the ip that is forbidden the HttpResponseImpl that this error belongs to |
getCode | public int getCode()(Code) | | gets the HTTP response code
the HTTP response code |
getContentType | public String getContentType()(Code) | | gets the content type that will be sent to the browser
the content type (i.e. "text/html") |
getHeader | public String getHeader(String name)(Code) | | Gets a header based on the name passed in
Parameters: name - The name of the header the value of the header |
getOutputStream | public OutputStream getOutputStream()(Code) | | gets the OutputStream to send data to the browser
the OutputStream to send data to the browser |
getPrintWriter | public PrintWriter getPrintWriter()(Code) | | Gets the PrintWriter to send data to the browser
the PrintWriter to send data to the browser |
getServerName | public String getServerName()(Code) | | gets the name of the server being used
the name of the server |
getStatusCode | public int getStatusCode()(Code) | | |
reset | public void reset()(Code) | | resets the data to be sent to the browser
|
reset | public void reset(int code, String responseString)(Code) | | resets the data to be sent to the browser with the response code and response
string
Parameters: code - the code to be sent to the browser Parameters: responseString - the response string to be sent to the browser |
setCode | public void setCode(int code)(Code) | | sets the HTTP response code to be sent to the browser. These codes are:
OPTIONS = 0
GET = 1
HEAD = 2
POST = 3
PUT = 4
DELETE = 5
TRACE = 6
CONNECT = 7
UNSUPPORTED = 8
Parameters: code - the code to be sent to the browser |
setContent | public void setContent(URLConnection content)(Code) | | Parameters: content - The content to set. |
setContentType | public void setContentType(String type)(Code) | | sets the content type to be sent back to the browser
Parameters: type - the type to be sent to the browser (i.e. "text/html") |
setHeader | public void setHeader(String name, String value)(Code) | | sets a header to be sent back to the browser
Parameters: name - the name of the header Parameters: value - the value of the header |
setResponseString | public void setResponseString(String responseString)(Code) | | Sets the response string to be sent to the browser
Parameters: responseString - the response string |
setStatusCode | public void setStatusCode(int code)(Code) | | |
setStatusMessage | public void setStatusMessage(String responseString)(Code) | | |
toString | public String toString()(Code) | | Creates a string version of the response similar to:
HTTP/1.1 200 OK
the string value of this HttpResponseImpl |
writeMessage | protected void writeMessage(OutputStream output) throws IOException(Code) | | Takes care of sending the response line, headers and body
HTTP/1.1 200 OK
Server: Netscape-Enterprise/3.6 SP3
Date: Thu, 07 Jun 2001 17:30:42 GMT
Content-Type: text/html
Connection: close
Parameters: output - the output to send the response to throws: java.io.IOException - if an exception is thrown |
|
|
|