org.apache.catalina.connector
クラス HttpResponseBase

java.lang.Object
  |
  +--org.apache.catalina.connector.ResponseBase
        |
        +--org.apache.catalina.connector.HttpResponseBase
すべての実装インタフェース:
HttpResponse, javax.servlet.http.HttpServletResponse, Response, javax.servlet.ServletResponse
直系の既知のサブクラス:
WarpResponse

public class HttpResponseBase
extends ResponseBase
implements HttpResponse, javax.servlet.http.HttpServletResponse

Convenience base implementation of the HttpResponse interface, which can be used for the Response implementation required by most Connectors that deal with HTTP. Only the connector-specific methods need to be implemented.

バージョン:
$Revision: 1.37.2.13 $ $Date: 2002/04/05 18:44:21 $
作成者:
Craig R. McClanahan, Remy Maucherat

フィールドの概要
protected  java.util.ArrayList cookies
          The set of Cookies associated with this Response.
protected  HttpResponseFacade facade
          The facade associated with this response.
protected  java.text.SimpleDateFormat format
          The date format we will use for creating date headers.
protected  java.util.HashMap headers
          The HTTP headers explicitly added via addHeader(), but not including those to be added with setContentLength(), setContentType(), and so on.
protected static java.lang.String info
          Descriptive information about this HttpResponse implementation.
protected  java.lang.String message
          The error message set by sendError().
protected  int status
          The HTTP status code associated with this Response.
protected static java.util.TimeZone zone
          The time zone with which to construct date headers.
 
クラス org.apache.catalina.connector.ResponseBase から継承したフィールド
appCommitted, buffer, bufferCount, committed, connector, contentCount, contentLength, contentType, context, encoding, error, included, locale, output, request, sm, stream, suspended, writer
 
インタフェース javax.servlet.http.HttpServletResponse から継承したフィールド
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
 
コンストラクタの概要
HttpResponseBase()
           
 
メソッドの概要
 void addCookie(javax.servlet.http.Cookie cookie)
          Add the specified Cookie to those that will be included with this Response.
 void addDateHeader(java.lang.String name, long value)
          Add the specified date header to the specified value.
 void addHeader(java.lang.String name, java.lang.String value)
          Add the specified header to the specified value.
 void addIntHeader(java.lang.String name, int value)
          Add the specified integer header to the specified value.
 boolean containsHeader(java.lang.String name)
          Has the specified header been set already in this response?
 java.lang.String encodeRedirectUrl(java.lang.String url)
          推奨されていません。 As of Version 2.1 of the Java Servlet API, use encodeRedirectURL() instead.
 java.lang.String encodeRedirectURL(java.lang.String url)
          Encode the session identifier associated with this response into the specified redirect URL, if necessary.
 java.lang.String encodeUrl(java.lang.String url)
          推奨されていません。 As of Version 2.1 of the Java Servlet API, use encodeURL() instead.
 java.lang.String encodeURL(java.lang.String url)
          Encode the session identifier associated with this response into the specified URL, if necessary.
 void finishResponse()
          Perform whatever actions are required to flush and close the output stream or writer, in a single operation.
 void flushBuffer()
          Flush the buffer and commit this response.
 javax.servlet.http.Cookie[] getCookies()
          Return an array of all cookies set for this response, or a zero-length array if no cookies have been set.
 java.lang.String getHeader(java.lang.String name)
          Return the value for the specified header, or null if this header has not been set.
 java.lang.String[] getHeaderNames()
          Return an array of all the header names set for this response, or a zero-length array if no headers have been set.
 java.lang.String[] getHeaderValues(java.lang.String name)
          Return an array of all the header values associated with the specified header name, or an zero-length array if there are no such header values.
 java.lang.String getMessage()
          Return the error message that was set with sendError() for this Response.
protected  java.lang.String getProtocol()
          Return the HTTP protocol version implemented by this response object.
 javax.servlet.ServletResponse getResponse()
          Return the ServletResponse for which this object is the facade.
 int getStatus()
          Return the HTTP status code associated with this Response.
protected  java.lang.String getStatusMessage(int status)
          Returns a default status message for the specified HTTP status code.
 void recycle()
          Release all object references, and initialize instance variables, in preparation for reuse of this object.
 void reset()
          Clear any content written to the buffer.
 void reset(int status, java.lang.String message)
          Reset this response, and specify the values for the HTTP status code and corresponding message.
 void sendError(int status)
          Send an error response with the specified status and a default message.
 void sendError(int status, java.lang.String message)
          Send an error response with the specified status and message.
protected  void sendHeaders()
          Send the HTTP response headers, if this has not already occurred.
 void sendRedirect(java.lang.String location)
          Send a temporary redirect to the specified redirect location URL.
 void setContentLength(int length)
          Set the content length (in bytes) for this Response.
 void setContentType(java.lang.String type)
          Set the content type for this Response.
 void setDateHeader(java.lang.String name, long value)
          Set the specified date header to the specified value.
 void setHeader(java.lang.String name, java.lang.String value)
          Set the specified header to the specified value.
 void setIntHeader(java.lang.String name, int value)
          Set the specified integer header to the specified value.
 void setLocale(java.util.Locale locale)
          Set the Locale that is appropriate for this response, including setting the appropriate character encoding.
 void setStatus(int status)
          Set the HTTP status to be returned with this response.
 void setStatus(int status, java.lang.String message)
          推奨されていません。 As of Version 2.1 of the Java Servlet API, this method has been deprecated due to the ambiguous meaning of the message parameter.
 
クラス org.apache.catalina.connector.ResponseBase から継承したメソッド
createOutputStream, getBufferSize, getCharacterEncoding, getConnector, getContentCount, getContentLength, getContentType, getContext, getIncluded, getInfo, getLocale, getOutputStream, getReporter, getRequest, getStream, getWriter, isAppCommitted, isCommitted, isError, isSuspended, resetBuffer, setAppCommitted, setBufferSize, setConnector, setContext, setError, setIncluded, setRequest, setStream, setSuspended, write, write, write
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.apache.catalina.Response から継承したメソッド
createOutputStream, getConnector, getContentCount, getContentLength, getContentType, getContext, getIncluded, getInfo, getReporter, getRequest, getStream, isAppCommitted, isError, isSuspended, resetBuffer, setAppCommitted, setConnector, setContext, setError, setIncluded, setRequest, setStream, setSuspended
 
インタフェース javax.servlet.ServletResponse から継承したメソッド
getBufferSize, getCharacterEncoding, getLocale, getOutputStream, getWriter, isCommitted, resetBuffer, setBufferSize
 

フィールドの詳細

cookies

protected java.util.ArrayList cookies
The set of Cookies associated with this Response.

format

protected final java.text.SimpleDateFormat format
The date format we will use for creating date headers.

facade

protected HttpResponseFacade facade
The facade associated with this response.

headers

protected java.util.HashMap headers
The HTTP headers explicitly added via addHeader(), but not including those to be added with setContentLength(), setContentType(), and so on. This collection is keyed by the header name, and the elements are ArrayLists containing the associated values that have been set.

info

protected static final java.lang.String info
Descriptive information about this HttpResponse implementation.

message

protected java.lang.String message
The error message set by sendError().

status

protected int status
The HTTP status code associated with this Response.

zone

protected static final java.util.TimeZone zone
The time zone with which to construct date headers.
コンストラクタの詳細

HttpResponseBase

public HttpResponseBase()
メソッドの詳細

getResponse

public javax.servlet.ServletResponse getResponse()
Return the ServletResponse for which this object is the facade.
定義:
インタフェース Response 内の getResponse
オーバーライド:
クラス ResponseBase 内の getResponse

finishResponse

public void finishResponse()
                    throws java.io.IOException
Perform whatever actions are required to flush and close the output stream or writer, in a single operation.
定義:
インタフェース Response 内の finishResponse
オーバーライド:
クラス ResponseBase 内の finishResponse
例外:
java.io.IOException - if an input/output error occurs

getCookies

public javax.servlet.http.Cookie[] getCookies()
Return an array of all cookies set for this response, or a zero-length array if no cookies have been set.
定義:
インタフェース HttpResponse 内の getCookies

getHeader

public java.lang.String getHeader(java.lang.String name)
Return the value for the specified header, or null if this header has not been set. If more than one value was added for this name, only the first is returned; use getHeaderValues() to retrieve all of them.
定義:
インタフェース HttpResponse 内の getHeader
パラメータ:
name - Header name to look up

getHeaderNames

public java.lang.String[] getHeaderNames()
Return an array of all the header names set for this response, or a zero-length array if no headers have been set.
定義:
インタフェース HttpResponse 内の getHeaderNames

getHeaderValues

public java.lang.String[] getHeaderValues(java.lang.String name)
Return an array of all the header values associated with the specified header name, or an zero-length array if there are no such header values.
定義:
インタフェース HttpResponse 内の getHeaderValues
パラメータ:
name - Header name to look up

getMessage

public java.lang.String getMessage()
Return the error message that was set with sendError() for this Response.
定義:
インタフェース HttpResponse 内の getMessage

getStatus

public int getStatus()
Return the HTTP status code associated with this Response.
定義:
インタフェース HttpResponse 内の getStatus

recycle

public void recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object.
定義:
インタフェース Response 内の recycle
オーバーライド:
クラス ResponseBase 内の recycle

reset

public void reset(int status,
                  java.lang.String message)
Reset this response, and specify the values for the HTTP status code and corresponding message.
定義:
インタフェース HttpResponse 内の reset
例外:
java.lang.IllegalStateException - if this response has already been committed

getStatusMessage

protected java.lang.String getStatusMessage(int status)
Returns a default status message for the specified HTTP status code.
パラメータ:
status - The status code for which a message is desired

getProtocol

protected java.lang.String getProtocol()
Return the HTTP protocol version implemented by this response object. (This method must be overridden by subclasses of this as to correctly return the highest HTTP version number supported as specified in Section 3.1 of RFC-2616).
戻り値:
A string in the form of "HTTP/1.0" ...

sendHeaders

protected void sendHeaders()
                    throws java.io.IOException
Send the HTTP response headers, if this has not already occurred.

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Flush the buffer and commit this response. If this is the first output, send the HTTP headers prior to the user data.
定義:
インタフェース javax.servlet.ServletResponse 内の flushBuffer
オーバーライド:
クラス ResponseBase 内の flushBuffer
例外:
java.io.IOException - if an input/output error occurs

reset

public void reset()
Clear any content written to the buffer. In addition, all cookies and headers are cleared, and the status is reset.
定義:
インタフェース javax.servlet.ServletResponse 内の reset
オーバーライド:
クラス ResponseBase 内の reset
例外:
java.lang.IllegalStateException - if this response has already been committed

setContentLength

public void setContentLength(int length)
Set the content length (in bytes) for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の setContentLength
オーバーライド:
クラス ResponseBase 内の setContentLength
パラメータ:
length - The new content length

setContentType

public void setContentType(java.lang.String type)
Set the content type for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の setContentType
オーバーライド:
クラス ResponseBase 内の setContentType
パラメータ:
type - The new content type

setLocale

public void setLocale(java.util.Locale locale)
Set the Locale that is appropriate for this response, including setting the appropriate character encoding.
定義:
インタフェース javax.servlet.ServletResponse 内の setLocale
オーバーライド:
クラス ResponseBase 内の setLocale
パラメータ:
locale - The new locale

addCookie

public void addCookie(javax.servlet.http.Cookie cookie)
Add the specified Cookie to those that will be included with this Response.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の addCookie
パラメータ:
cookie - Cookie to be added

addDateHeader

public void addDateHeader(java.lang.String name,
                          long value)
Add the specified date header to the specified value.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の addDateHeader
パラメータ:
name - Name of the header to set
value - Date value to be set

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Add the specified header to the specified value.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の addHeader
パラメータ:
name - Name of the header to set
value - Value to be set

addIntHeader

public void addIntHeader(java.lang.String name,
                         int value)
Add the specified integer header to the specified value.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の addIntHeader
パラメータ:
name - Name of the header to set
value - Integer value to be set

containsHeader

public boolean containsHeader(java.lang.String name)
Has the specified header been set already in this response?
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の containsHeader
パラメータ:
name - Name of the header to check

encodeRedirectURL

public java.lang.String encodeRedirectURL(java.lang.String url)
Encode the session identifier associated with this response into the specified redirect URL, if necessary.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の encodeRedirectURL
パラメータ:
url - URL to be encoded

encodeRedirectUrl

public java.lang.String encodeRedirectUrl(java.lang.String url)
推奨されていません。 As of Version 2.1 of the Java Servlet API, use encodeRedirectURL() instead.

Encode the session identifier associated with this response into the specified redirect URL, if necessary.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の encodeRedirectUrl
パラメータ:
url - URL to be encoded

encodeURL

public java.lang.String encodeURL(java.lang.String url)
Encode the session identifier associated with this response into the specified URL, if necessary.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の encodeURL
パラメータ:
url - URL to be encoded

encodeUrl

public java.lang.String encodeUrl(java.lang.String url)
推奨されていません。 As of Version 2.1 of the Java Servlet API, use encodeURL() instead.

Encode the session identifier associated with this response into the specified URL, if necessary.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の encodeUrl
パラメータ:
url - URL to be encoded

sendError

public void sendError(int status)
               throws java.io.IOException
Send an error response with the specified status and a default message.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の sendError
パラメータ:
status - HTTP status code to send
例外:
java.lang.IllegalStateException - if this response has already been committed
java.io.IOException - if an input/output error occurs

sendError

public void sendError(int status,
                      java.lang.String message)
               throws java.io.IOException
Send an error response with the specified status and message.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の sendError
パラメータ:
status - HTTP status code to send
message - Corresponding message to send
例外:
java.lang.IllegalStateException - if this response has already been committed
java.io.IOException - if an input/output error occurs

sendRedirect

public void sendRedirect(java.lang.String location)
                  throws java.io.IOException
Send a temporary redirect to the specified redirect location URL.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の sendRedirect
パラメータ:
location - Location URL to redirect to
例外:
java.lang.IllegalStateException - if this response has already been committed
java.io.IOException - if an input/output error occurs

setDateHeader

public void setDateHeader(java.lang.String name,
                          long value)
Set the specified date header to the specified value.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の setDateHeader
パラメータ:
name - Name of the header to set
value - Date value to be set

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Set the specified header to the specified value.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の setHeader
パラメータ:
name - Name of the header to set
value - Value to be set

setIntHeader

public void setIntHeader(java.lang.String name,
                         int value)
Set the specified integer header to the specified value.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の setIntHeader
パラメータ:
name - Name of the header to set
value - Integer value to be set

setStatus

public void setStatus(int status)
Set the HTTP status to be returned with this response.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の setStatus
パラメータ:
status - The new HTTP status

setStatus

public void setStatus(int status,
                      java.lang.String message)
推奨されていません。 As of Version 2.1 of the Java Servlet API, this method has been deprecated due to the ambiguous meaning of the message parameter.

Set the HTTP status and message to be returned with this response.
定義:
インタフェース javax.servlet.http.HttpServletResponse 内の setStatus
パラメータ:
status - The new HTTP status
message - The associated text message


Copyright ? 2000-2001 Apache Software Foundation. All Rights Reserved.