org.openejb.server.httpd
Interface HttpResponse

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
HttpResponseImpl

public interface HttpResponse
extends java.io.Serializable

This interface takes care of HTTP Responses. It sends data back to the browser.


Method Summary
 java.lang.String getContentType()
          gets the content type that will be sent to the browser
 java.lang.String getHeader(java.lang.String name)
          Gets a header based on the name passed in
 java.io.OutputStream getOutputStream()
          gets the OutputStream to send data to the browser
 java.io.PrintWriter getPrintWriter()
          Gets the PrintWriter to send data to the browser
 int getStatusCode()
          gets the HTTP response code
 void setContentType(java.lang.String type)
          sets the content type to be sent back to the browser
 void setHeader(java.lang.String name, java.lang.String value)
          sets a header to be sent back to the browser
 void setStatusCode(int code)
          sets the HTTP response code to be sent to the browser.
 void setStatusMessage(java.lang.String responseString)
          Sets the response string to be sent to the browser
 

Method Detail

setHeader

void setHeader(java.lang.String name,
               java.lang.String value)
sets a header to be sent back to the browser

Parameters:
name - the name of the header
value - the value of the header

getHeader

java.lang.String getHeader(java.lang.String name)
Gets a header based on the name passed in

Parameters:
name - The name of the header
Returns:
the value of the header

getPrintWriter

java.io.PrintWriter getPrintWriter()
Gets the PrintWriter to send data to the browser

Returns:
the PrintWriter to send data to the browser

getOutputStream

java.io.OutputStream getOutputStream()
gets the OutputStream to send data to the browser

Returns:
the OutputStream to send data to the browser

setContentType

void setContentType(java.lang.String type)
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")

getContentType

java.lang.String getContentType()
gets the content type that will be sent to the browser

Returns:
the content type (i.e. "text/html")

setStatusCode

void setStatusCode(int 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

getStatusCode

int getStatusCode()
gets the HTTP response code

Returns:
the HTTP response code

setStatusMessage

void setStatusMessage(java.lang.String responseString)
Sets the response string to be sent to the browser

Parameters:
responseString - the response string


Copyright © 1999-2011 OpenEJB. All Rights Reserved.