org.openejb.webadmin
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.

Author:
David Blevins

Method Summary
 int getCode()
          gets the HTTP response code
 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
 java.lang.String getServerName()
          gets the name of the server being used
 void reset()
          resets the data to be sent to the browser
 void reset(int code, java.lang.String responseString)
          resets the data to be sent to the browser with the response code and response string
 void setCode(int code)
          sets the HTTP response code to be sent to the browser.
 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 setResponseString(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

setCode

void setCode(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

getCode

int getCode()
gets the HTTP response code

Returns:
the HTTP response code

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")

setResponseString

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

Parameters:
responseString - the response string

reset

void reset()
resets the data to be sent to the browser


reset

void reset(int code,
           java.lang.String responseString)
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
responseString - the response string to be sent to the browser

getServerName

java.lang.String getServerName()
gets the name of the server being used

Returns:
the name of the server


Copyright © 1999-2011 OpenEJB. All Rights Reserved.