All Packages Class Hierarchy This Package Previous Next Index
Interface Acme.Serve.servlet.http.HttpServletResponse
- public interface HttpServletResponse
- extends ServletResponse
This interface represents an HTTP response.
This is taken from JavaSoft's Servlet API documentation.
Fetch the software.
Fetch the entire Acme package.
- See Also:
- Servlet
-
SC_ACCEPTED
-
-
SC_BAD_GATEWAY
-
-
SC_BAD_REQUEST
-
-
SC_CONFLICT
-
-
SC_CONTINUE
-
-
SC_CREATED
-
-
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_RESET_CONTENT
-
-
SC_SEE_OTHER
-
-
SC_SERVICE_UNAVAILABLE
-
-
SC_SWITCHING_PROTOCOLS
-
-
SC_UNAUTHORIZED
-
-
SC_UNSUPPORTED_MEDIA_TYPE
-
-
SC_USE_PROXY
-
-
addCookie(Cookie)
- Adds the specified cookie to the response.
-
containsHeader(String)
- Checks whether the response message header has a field with the
specified name.
-
encodeRedirectUrl(String)
- Encodes the specified URL for use in the sendRedirect method or, if
encoding is not needed, returns the URL unchanged.
-
encodeUrl(String)
- Encodes the specified URL by including the session ID in it, or, if
encoding is not needed, returns the URL unchanged.
-
sendError(int)
- Writes an error response using the specified status code and a default
message.
-
sendError(int, String)
- Writes an error response using the specified status code and message.
-
sendRedirect(String)
- Sends a redirect message to the client using the specified redirect
location URL.
-
setDateHeader(String, long)
- Sets the value of a date header field.
-
setHeader(String, String)
- Sets the value of a header field.
-
setIntHeader(String, int)
- Sets the value of an integer header field.
-
setLongHeader(String, long)
- Sets the value of a long header field.
-
setStatus(int)
- Sets the status code and a default message for this response.
-
setStatus(int, String)
- Sets the status code and message for this response.
SC_CONTINUE
public static final int SC_CONTINUE
SC_SWITCHING_PROTOCOLS
public static final int SC_SWITCHING_PROTOCOLS
SC_OK
public static final int SC_OK
SC_CREATED
public static final int SC_CREATED
SC_ACCEPTED
public static final int SC_ACCEPTED
SC_NON_AUTHORITATIVE_INFORMATION
public static final int SC_NON_AUTHORITATIVE_INFORMATION
SC_NO_CONTENT
public static final int SC_NO_CONTENT
SC_RESET_CONTENT
public static final int SC_RESET_CONTENT
SC_PARTIAL_CONTENT
public static final int SC_PARTIAL_CONTENT
SC_MULTIPLE_CHOICES
public static final int SC_MULTIPLE_CHOICES
SC_MOVED_PERMANENTLY
public static final int SC_MOVED_PERMANENTLY
SC_MOVED_TEMPORARILY
public static final int SC_MOVED_TEMPORARILY
SC_SEE_OTHER
public static final int SC_SEE_OTHER
SC_NOT_MODIFIED
public static final int SC_NOT_MODIFIED
SC_USE_PROXY
public static final int SC_USE_PROXY
SC_BAD_REQUEST
public static final int SC_BAD_REQUEST
SC_UNAUTHORIZED
public static final int SC_UNAUTHORIZED
SC_PAYMENT_REQUIRED
public static final int SC_PAYMENT_REQUIRED
SC_FORBIDDEN
public static final int SC_FORBIDDEN
SC_NOT_FOUND
public static final int SC_NOT_FOUND
SC_METHOD_NOT_ALLOWED
public static final int SC_METHOD_NOT_ALLOWED
SC_NOT_ACCEPTABLE
public static final int SC_NOT_ACCEPTABLE
SC_PROXY_AUTHENTICATION_REQUIRED
public static final int SC_PROXY_AUTHENTICATION_REQUIRED
SC_REQUEST_TIMEOUT
public static final int SC_REQUEST_TIMEOUT
SC_CONFLICT
public static final int SC_CONFLICT
SC_GONE
public static final int SC_GONE
SC_LENGTH_REQUIRED
public static final int SC_LENGTH_REQUIRED
SC_PRECONDITION_FAILED
public static final int SC_PRECONDITION_FAILED
SC_REQUEST_ENTITY_TOO_LARGE
public static final int SC_REQUEST_ENTITY_TOO_LARGE
SC_REQUEST_URI_TOO_LONG
public static final int SC_REQUEST_URI_TOO_LONG
SC_UNSUPPORTED_MEDIA_TYPE
public static final int SC_UNSUPPORTED_MEDIA_TYPE
SC_INTERNAL_SERVER_ERROR
public static final int SC_INTERNAL_SERVER_ERROR
SC_NOT_IMPLEMENTED
public static final int SC_NOT_IMPLEMENTED
SC_BAD_GATEWAY
public static final int SC_BAD_GATEWAY
SC_SERVICE_UNAVAILABLE
public static final int SC_SERVICE_UNAVAILABLE
SC_GATEWAY_TIMEOUT
public static final int SC_GATEWAY_TIMEOUT
SC_HTTP_VERSION_NOT_SUPPORTED
public static final int SC_HTTP_VERSION_NOT_SUPPORTED
addCookie
public abstract void addCookie(Cookie cookie)
- Adds the specified cookie to the response. It can be called
multiple times to set more than one cookie.
containsHeader
public abstract boolean containsHeader(String name)
- Checks whether the response message header has a field with the
specified name.
setStatus
public abstract void setStatus(int code,
String msg)
- Sets the status code and message for this response.
- Parameters:
- code - the status code
- msg - the status message
setStatus
public abstract void setStatus(int code)
- Sets the status code and a default message for this response.
- Parameters:
- code - the status code
setHeader
public abstract void setHeader(String name,
String value)
- Sets the value of a header field.
- Parameters:
- name - the header field name
- value - the header field value
setIntHeader
public abstract void setIntHeader(String name,
int value)
- Sets the value of an integer header field.
- Parameters:
- name - the header field name
- value - the header field integer value
setLongHeader
public abstract void setLongHeader(String name,
long value)
- Sets the value of a long header field.
- Parameters:
- name - the header field name
- value - the header field long value
setDateHeader
public abstract void setDateHeader(String name,
long date)
- Sets the value of a date header field.
- Parameters:
- name - the header field name
- value - the header field date value
sendError
public abstract void sendError(int code,
String msg) throws IOException
- Writes an error response using the specified status code and message.
- Parameters:
- code - the status code
- msg - the status message
- Throws: IOException
- if an I/O error has occurred
sendError
public abstract void sendError(int code) throws IOException
- Writes an error response using the specified status code and a default
message.
- Parameters:
- code - the status code
- Throws: IOException
- if an I/O error has occurred
sendRedirect
public abstract void sendRedirect(String location) throws IOException
- Sends a redirect message to the client using the specified redirect
location URL.
- Parameters:
- location - the redirect location URL
- Throws: IOException
- if an I/O error has occurred
encodeUrl
public abstract String encodeUrl(String url)
- Encodes the specified URL by including the session ID in it, or, if
encoding is not needed, returns the URL unchanged. The
implementation of this method should include the logic to determine
whether the session ID needs to be encoded in the URL. For example,
if the browser supports cookies, or session tracking is turned off,
URL encoding is unnecessary.
All URLs emitted by a Servlet should be run through this method.
Otherwise, URL rewriting cannot be used with browsers which do not
support cookies.
encodeRedirectUrl
public abstract String encodeRedirectUrl(String url)
- Encodes the specified URL for use in the sendRedirect method or, if
encoding is not needed, returns the URL unchanged. The
implementation of this method should include the logic to determine
whether the session ID needs to be encoded in the URL. Because the
rules for making this determination differ from those used to
decide whether to encode a normal link, this method is seperate
from the encodeUrl method.
All URLs sent to the HttpServletResponse.sendRedirect method should be
run through this method. Otherwise, URL rewriting cannot be used with
browsers which do not support cookies.
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs