|
|||||||||
| Home >> All >> org >> mortbay >> [ http overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.mortbay.http
Class HttpResponse

java.lang.Objectorg.mortbay.http.HttpMessage
org.mortbay.http.HttpResponse
- public class HttpResponse
- extends HttpMessage
HTTP Response. This class manages the headers, trailers and content streams of a HTTP response. It can be used for receiving or generating requests. This class is not synchronized. It should be explicitly synchronized if it is used by multiple threads.
- Version:
- $Id: HttpResponse.java,v 1.50 2003/11/22 16:06:02 gregwilkins Exp $
| Nested Class Summary |
| Nested classes inherited from class org.mortbay.http.HttpMessage |
HttpMessage.HeaderWriter |
| Fields inherited from class org.mortbay.http.HttpMessage |
__HTTP_0_9, __HTTP_1_0, __HTTP_1_1, __HTTP_1_X, __MSG_BAD, __MSG_EDITABLE, __MSG_RECEIVED, __MSG_SENDING, __MSG_SENT, __SCHEME, __SSL_SCHEME, __state, _attributes, _characterEncoding, _connection, _dotVersion, _header, _mimeType, _state, _version, _wrapper |
| Constructor Summary | |
HttpResponse()
Constructor. |
|
HttpResponse(HttpConnection connection)
Constructor. |
|
| Method Summary | |
void |
addSetCookie(javax.servlet.http.Cookie cookie)
Add a Set-Cookie field. |
void |
addSetCookie(javax.servlet.http.Cookie cookie,
boolean cookie2)
Add a Set-Cookie field. |
void |
addSetCookie(java.lang.String name,
java.lang.String value)
Add a Set-Cookie field. |
void |
commit()
|
void |
destroy()
Destroy the response. |
HttpContext |
getHttpContext()
Get the HttpContext handling this reponse. |
HttpRequest |
getHttpRequest()
Get the HTTP Request. |
java.lang.String |
getReason()
|
HttpRequest |
getRequest()
Deprecated. use getHttpRequest() |
int |
getStatus()
|
boolean |
isDirty()
|
void |
readHeader(HttpInputStream in)
Not Implemented. |
(package private) void |
recycle(HttpConnection connection)
Recycle the response. |
void |
reset()
Reset the response. |
void |
sendError(int code)
Sends an error response to the client using the specified status code and no default message. |
void |
sendError(int code,
java.lang.String message)
Send Error Response. |
void |
sendRedirect(java.lang.String location)
Sends a redirect response to the client using the specified redirect location URL. |
(package private) void |
setHttpContext(HttpContext context)
Set the HttpContext handling this reponse. |
void |
setReason(java.lang.String reason)
|
void |
setStatus(int status)
|
void |
writeHeader(java.io.Writer writer)
Write the message header. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
log
private static org.apache.commons.logging.Log log
__100_Continue
public static final int __100_Continue
- See Also:
- Constant Field Values
__101_Switching_Protocols
public static final int __101_Switching_Protocols
- See Also:
- Constant Field Values
__102_Processing
public static final int __102_Processing
- See Also:
- Constant Field Values
__200_OK
public static final int __200_OK
- See Also:
- Constant Field Values
__201_Created
public static final int __201_Created
- See Also:
- Constant Field Values
__202_Accepted
public static final int __202_Accepted
- See Also:
- Constant Field Values
__203_Non_Authoritative_Information
public static final int __203_Non_Authoritative_Information
- See Also:
- Constant Field Values
__204_No_Content
public static final int __204_No_Content
- See Also:
- Constant Field Values
__205_Reset_Content
public static final int __205_Reset_Content
- See Also:
- Constant Field Values
__206_Partial_Content
public static final int __206_Partial_Content
- See Also:
- Constant Field Values
__207_Multi_Status
public static final int __207_Multi_Status
- See Also:
- Constant Field Values
__300_Multiple_Choices
public static final int __300_Multiple_Choices
- See Also:
- Constant Field Values
__301_Moved_Permanently
public static final int __301_Moved_Permanently
- See Also:
- Constant Field Values
__302_Moved_Temporarily
public static final int __302_Moved_Temporarily
- See Also:
- Constant Field Values
__302_Found
public static final int __302_Found
- See Also:
- Constant Field Values
__303_See_Other
public static final int __303_See_Other
- See Also:
- Constant Field Values
__304_Not_Modified
public static final int __304_Not_Modified
- See Also:
- Constant Field Values
__305_Use_Proxy
public static final int __305_Use_Proxy
- See Also:
- Constant Field Values
__400_Bad_Request
public static final int __400_Bad_Request
- See Also:
- Constant Field Values
__401_Unauthorized
public static final int __401_Unauthorized
- See Also:
- Constant Field Values
__402_Payment_Required
public static final int __402_Payment_Required
- See Also:
- Constant Field Values
__403_Forbidden
public static final int __403_Forbidden
- See Also:
- Constant Field Values
__404_Not_Found
public static final int __404_Not_Found
- See Also:
- Constant Field Values
__405_Method_Not_Allowed
public static final int __405_Method_Not_Allowed
- See Also:
- Constant Field Values
__406_Not_Acceptable
public static final int __406_Not_Acceptable
- See Also:
- Constant Field Values
__407_Proxy_Authentication_Required
public static final int __407_Proxy_Authentication_Required
- See Also:
- Constant Field Values
__408_Request_Timeout
public static final int __408_Request_Timeout
- See Also:
- Constant Field Values
__409_Conflict
public static final int __409_Conflict
- See Also:
- Constant Field Values
__410_Gone
public static final int __410_Gone
- See Also:
- Constant Field Values
__411_Length_Required
public static final int __411_Length_Required
- See Also:
- Constant Field Values
__412_Precondition_Failed
public static final int __412_Precondition_Failed
- See Also:
- Constant Field Values
__413_Request_Entity_Too_Large
public static final int __413_Request_Entity_Too_Large
- See Also:
- Constant Field Values
__414_Request_URI_Too_Large
public static final int __414_Request_URI_Too_Large
- See Also:
- Constant Field Values
__415_Unsupported_Media_Type
public static final int __415_Unsupported_Media_Type
- See Also:
- Constant Field Values
__416_Requested_Range_Not_Satisfiable
public static final int __416_Requested_Range_Not_Satisfiable
- See Also:
- Constant Field Values
__417_Expectation_Failed
public static final int __417_Expectation_Failed
- See Also:
- Constant Field Values
__422_Unprocessable_Entity
public static final int __422_Unprocessable_Entity
- See Also:
- Constant Field Values
__423_Locked
public static final int __423_Locked
- See Also:
- Constant Field Values
__424_Failed_Dependency
public static final int __424_Failed_Dependency
- See Also:
- Constant Field Values
__500_Internal_Server_Error
public static final int __500_Internal_Server_Error
- See Also:
- Constant Field Values
__501_Not_Implemented
public static final int __501_Not_Implemented
- See Also:
- Constant Field Values
__502_Bad_Gateway
public static final int __502_Bad_Gateway
- See Also:
- Constant Field Values
__503_Service_Unavailable
public static final int __503_Service_Unavailable
- See Also:
- Constant Field Values
__504_Gateway_Timeout
public static final int __504_Gateway_Timeout
- See Also:
- Constant Field Values
__505_HTTP_Version_Not_Supported
public static final int __505_HTTP_Version_Not_Supported
- See Also:
- Constant Field Values
__507_Insufficient_Storage
public static final int __507_Insufficient_Storage
- See Also:
- Constant Field Values
__statusMsg
public static final java.util.HashMap __statusMsg
__Continue
static byte[] __Continue
_status
private int _status
_reason
private java.lang.String _reason
_httpContext
private HttpContext _httpContext
| Constructor Detail |
HttpResponse
public HttpResponse()
- Constructor.
HttpResponse
public HttpResponse(HttpConnection connection)
- Constructor.
| Method Detail |
getHttpContext
public HttpContext getHttpContext()
- Get the HttpContext handling this reponse.
setHttpContext
void setHttpContext(HttpContext context)
- Set the HttpContext handling this reponse.
isDirty
public boolean isDirty()
- Overrides:
isDirtyin classHttpMessage
reset
public void reset()
- Reset the response.
Clears any data that exists in the buffer as well as the status
code. If the response has been committed, this method throws an
IllegalStateException.- Overrides:
resetin classHttpMessage
getRequest
public HttpRequest getRequest()
- Deprecated. use getHttpRequest()
getHttpRequest
public HttpRequest getHttpRequest()
- Get the HTTP Request.
Get the HTTP Request associated with this response.
readHeader
public void readHeader(HttpInputStream in) throws java.io.IOException
- Not Implemented.
writeHeader
public void writeHeader(java.io.Writer writer) throws java.io.IOException
- Description copied from class:
HttpMessage - Write the message header.
- Specified by:
writeHeaderin classHttpMessage
getStatus
public int getStatus()
setStatus
public void setStatus(int status)
getReason
public java.lang.String getReason()
setReason
public void setReason(java.lang.String reason)
sendError
public void sendError(int code,
java.lang.String message)
throws java.io.IOException
- Send Error Response.
sendError
public void sendError(int code)
throws java.io.IOException
- Sends an error response to the client using the specified status
code and no default message.
sendRedirect
public void sendRedirect(java.lang.String location) throws java.io.IOException
- Sends a redirect response to the client using the specified redirect
location URL.
addSetCookie
public void addSetCookie(java.lang.String name, java.lang.String value)
- Add a Set-Cookie field.
addSetCookie
public void addSetCookie(javax.servlet.http.Cookie cookie)
- Add a Set-Cookie field.
addSetCookie
public void addSetCookie(javax.servlet.http.Cookie cookie, boolean cookie2)
- Add a Set-Cookie field.
commit
public void commit()
throws java.io.IOException
recycle
void recycle(HttpConnection connection)
- Recycle the response.
- Overrides:
recyclein classHttpMessage
destroy
public void destroy()
- Destroy the response.
Help the garbage collector by null everything that we can.
- Overrides:
destroyin classHttpMessage
|
|||||||||
| Home >> All >> org >> mortbay >> [ http overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC