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

Variable Index

 o SC_ACCEPTED
 o SC_BAD_GATEWAY
 o SC_BAD_REQUEST
 o SC_CONFLICT
 o SC_CONTINUE
 o SC_CREATED
 o SC_FORBIDDEN
 o SC_GATEWAY_TIMEOUT
 o SC_GONE
 o SC_HTTP_VERSION_NOT_SUPPORTED
 o SC_INTERNAL_SERVER_ERROR
 o SC_LENGTH_REQUIRED
 o SC_METHOD_NOT_ALLOWED
 o SC_MOVED_PERMANENTLY
 o SC_MOVED_TEMPORARILY
 o SC_MULTIPLE_CHOICES
 o SC_NO_CONTENT
 o SC_NON_AUTHORITATIVE_INFORMATION
 o SC_NOT_ACCEPTABLE
 o SC_NOT_FOUND
 o SC_NOT_IMPLEMENTED
 o SC_NOT_MODIFIED
 o SC_OK
 o SC_PARTIAL_CONTENT
 o SC_PAYMENT_REQUIRED
 o SC_PRECONDITION_FAILED
 o SC_PROXY_AUTHENTICATION_REQUIRED
 o SC_REQUEST_ENTITY_TOO_LARGE
 o SC_REQUEST_TIMEOUT
 o SC_REQUEST_URI_TOO_LONG
 o SC_RESET_CONTENT
 o SC_SEE_OTHER
 o SC_SERVICE_UNAVAILABLE
 o SC_SWITCHING_PROTOCOLS
 o SC_UNAUTHORIZED
 o SC_UNSUPPORTED_MEDIA_TYPE
 o SC_USE_PROXY

Method Index

 o addCookie(Cookie)
Adds the specified cookie to the response.
 o containsHeader(String)
Checks whether the response message header has a field with the specified name.
 o encodeRedirectUrl(String)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged.
 o encodeUrl(String)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
 o sendError(int)
Writes an error response using the specified status code and a default message.
 o sendError(int, String)
Writes an error response using the specified status code and message.
 o sendRedirect(String)
Sends a redirect message to the client using the specified redirect location URL.
 o setDateHeader(String, long)
Sets the value of a date header field.
 o setHeader(String, String)
Sets the value of a header field.
 o setIntHeader(String, int)
Sets the value of an integer header field.
 o setLongHeader(String, long)
Sets the value of a long header field.
 o setStatus(int)
Sets the status code and a default message for this response.
 o setStatus(int, String)
Sets the status code and message for this response.

Variables

 o SC_CONTINUE
 public static final int SC_CONTINUE
 o SC_SWITCHING_PROTOCOLS
 public static final int SC_SWITCHING_PROTOCOLS
 o SC_OK
 public static final int SC_OK
 o SC_CREATED
 public static final int SC_CREATED
 o SC_ACCEPTED
 public static final int SC_ACCEPTED
 o SC_NON_AUTHORITATIVE_INFORMATION
 public static final int SC_NON_AUTHORITATIVE_INFORMATION
 o SC_NO_CONTENT
 public static final int SC_NO_CONTENT
 o SC_RESET_CONTENT
 public static final int SC_RESET_CONTENT
 o SC_PARTIAL_CONTENT
 public static final int SC_PARTIAL_CONTENT
 o SC_MULTIPLE_CHOICES
 public static final int SC_MULTIPLE_CHOICES
 o SC_MOVED_PERMANENTLY
 public static final int SC_MOVED_PERMANENTLY
 o SC_MOVED_TEMPORARILY
 public static final int SC_MOVED_TEMPORARILY
 o SC_SEE_OTHER
 public static final int SC_SEE_OTHER
 o SC_NOT_MODIFIED
 public static final int SC_NOT_MODIFIED
 o SC_USE_PROXY
 public static final int SC_USE_PROXY
 o SC_BAD_REQUEST
 public static final int SC_BAD_REQUEST
 o SC_UNAUTHORIZED
 public static final int SC_UNAUTHORIZED
 o SC_PAYMENT_REQUIRED
 public static final int SC_PAYMENT_REQUIRED
 o SC_FORBIDDEN
 public static final int SC_FORBIDDEN
 o SC_NOT_FOUND
 public static final int SC_NOT_FOUND
 o SC_METHOD_NOT_ALLOWED
 public static final int SC_METHOD_NOT_ALLOWED
 o SC_NOT_ACCEPTABLE
 public static final int SC_NOT_ACCEPTABLE
 o SC_PROXY_AUTHENTICATION_REQUIRED
 public static final int SC_PROXY_AUTHENTICATION_REQUIRED
 o SC_REQUEST_TIMEOUT
 public static final int SC_REQUEST_TIMEOUT
 o SC_CONFLICT
 public static final int SC_CONFLICT
 o SC_GONE
 public static final int SC_GONE
 o SC_LENGTH_REQUIRED
 public static final int SC_LENGTH_REQUIRED
 o SC_PRECONDITION_FAILED
 public static final int SC_PRECONDITION_FAILED
 o SC_REQUEST_ENTITY_TOO_LARGE
 public static final int SC_REQUEST_ENTITY_TOO_LARGE
 o SC_REQUEST_URI_TOO_LONG
 public static final int SC_REQUEST_URI_TOO_LONG
 o SC_UNSUPPORTED_MEDIA_TYPE
 public static final int SC_UNSUPPORTED_MEDIA_TYPE
 o SC_INTERNAL_SERVER_ERROR
 public static final int SC_INTERNAL_SERVER_ERROR
 o SC_NOT_IMPLEMENTED
 public static final int SC_NOT_IMPLEMENTED
 o SC_BAD_GATEWAY
 public static final int SC_BAD_GATEWAY
 o SC_SERVICE_UNAVAILABLE
 public static final int SC_SERVICE_UNAVAILABLE
 o SC_GATEWAY_TIMEOUT
 public static final int SC_GATEWAY_TIMEOUT
 o SC_HTTP_VERSION_NOT_SUPPORTED
 public static final int SC_HTTP_VERSION_NOT_SUPPORTED

Methods

 o 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.

 o containsHeader
 public abstract boolean containsHeader(String name)
Checks whether the response message header has a field with the specified name.

 o 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
 o setStatus
 public abstract void setStatus(int code)
Sets the status code and a default message for this response.

Parameters:
code - the status code
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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.

 o 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