|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.http.HttpMessage | +--org.mortbay.http.HttpResponse
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.
HttpRequest
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 |
Constructor Summary | |
HttpResponse()
Constructor. |
|
HttpResponse(HttpConnection connection)
Constructor. |
Method Summary | |
void |
addSetCookie(Cookie cookie)
Add a Set-Cookie field. |
void |
addSetCookie(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. |
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. |
void |
setReason(java.lang.String reason)
|
void |
setStatus(int status)
|
void |
writeHeader(java.io.Writer writer)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int __100_Continue
public static final int __101_Switching_Protocols
public static final int __102_Processing
public static final int __200_OK
public static final int __201_Created
public static final int __202_Accepted
public static final int __203_Non_Authoritative_Information
public static final int __204_No_Content
public static final int __205_Reset_Content
public static final int __206_Partial_Content
public static final int __207_Multi_Status
public static final int __300_Multiple_Choices
public static final int __301_Moved_Permanently
public static final int __302_Moved_Temporarily
public static final int __303_See_Other
public static final int __304_Not_Modified
public static final int __305_Use_Proxy
public static final int __400_Bad_Request
public static final int __401_Unauthorized
public static final int __402_Payment_Required
public static final int __403_Forbidden
public static final int __404_Not_Found
public static final int __405_Method_Not_Allowed
public static final int __406_Not_Acceptable
public static final int __407_Proxy_Authentication_Required
public static final int __408_Request_Timeout
public static final int __409_Conflict
public static final int __410_Gone
public static final int __411_Length_Required
public static final int __412_Precondition_Failed
public static final int __413_Request_Entity_Too_Large
public static final int __414_Request_URI_Too_Large
public static final int __415_Unsupported_Media_Type
public static final int __416_Requested_Range_Not_Satisfiable
public static final int __417_Expectation_Failed
public static final int __422_Unprocessable_Entity
public static final int __423_Locked
public static final int __424_Failed_Dependency
public static final int __500_Internal_Server_Error
public static final int __501_Not_Implemented
public static final int __502_Bad_Gateway
public static final int __503_Service_Unavailable
public static final int __504_Gateway_Timeout
public static final int __505_HTTP_Version_Not_Supported
public static final int __507_Insufficient_Storage
public static final java.util.HashMap __statusMsg
Constructor Detail |
public HttpResponse()
public HttpResponse(HttpConnection connection)
connection
- Method Detail |
public HttpContext getHttpContext()
public boolean isDirty()
isDirty
in class HttpMessage
public void reset()
IllegalStateException
.
reset
in class HttpMessage
java.lang.IllegalStateException
- if the response has already been
committedpublic HttpRequest getRequest()
public HttpRequest getHttpRequest()
public void readHeader(HttpInputStream in) throws java.io.IOException
in
-
java.io.IOException
public void writeHeader(java.io.Writer writer) throws java.io.IOException
writeHeader
in class HttpMessage
java.io.IOException
public int getStatus()
public void setStatus(int status)
public java.lang.String getReason()
public void setReason(java.lang.String reason)
public void sendError(int code, java.lang.String message) throws java.io.IOException
java.io.IOException
public void sendError(int code) throws java.io.IOException
code
- the status code
java.io.IOException
- If an I/O error has occurred.public void sendRedirect(java.lang.String location) throws java.io.IOException
location
- the redirect location URL
java.io.IOException
- If an I/O error has occurred.public void addSetCookie(java.lang.String name, java.lang.String value)
public void addSetCookie(Cookie cookie)
public void addSetCookie(Cookie cookie, boolean cookie2)
cookie
- The cookie.cookie2
- If true, use the alternate cookie 2 headerpublic void commit() throws java.io.IOException
java.io.IOException
public void destroy()
destroy
in class HttpMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |