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

For robust session tracking, 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.

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
includes the logic to determine whether the session ID
needs to be encoded in the URL. Because the rules for making
this determination can differ from those used to decide whether to
encode a normal link, this method is separated 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.

Sends an error response to the client using the specified
status and clears the buffer. The server defaults to creating the
response to look like an HTML-formatted server error page
containing the specified message, setting the content type
to "text/html". The server will preserve cookies and may clear or
update any headers needed to serve the error page as a valid response.
If an error-page declaration has been made for the web application
corresponding to the status code passed in, it will be served back in
preference to the suggested msg parameter and the msg parameter will
be ignored.

If the response has already been committed, this method throws
an IllegalStateException.
After using this method, the response should be considered
to be committed and should not be written to.

Sends an error response to the client using the specified status
code and clears the buffer.
The server will preserve cookies and may clear or
update any headers needed to serve the error page as a valid response.
If an error-page declaration has been made for the web application
corresponding to the status code passed in, it will be served back
the error page

If the response has already been committed, this method throws
an IllegalStateException.
After using this method, the response should be considered
to be committed and should not be written to.

Sends a temporary redirect response to the client using the
specified redirect location URL and clears the buffer. The buffer will
be replaced with the data set by this method. Calling this method sets the
status code to SC_FOUND 302 (Found).
This method can accept relative URLs;the servlet container must convert
the relative URL to an absolute URL
before sending the response to the client. If the location is relative
without a leading '/' the container interprets it as relative to
the current request URI. If the location is relative with a leading
'/' the container interprets it as relative to the servlet container root.

If the response has already been committed, this method throws
an IllegalStateException.
After using this method, the response should be considered
to be committed and should not be written to.

Sets a response header with the given name and
date-value. The date is specified in terms of
milliseconds since the epoch. If the header had already
been set, the new value overwrites the previous one. The
containsHeader method can be used to test for the
presence of a header before setting its value.

Sets a response header with the given name and value.
If the header had already been set, the new value overwrites the
previous one. The containsHeader method can be
used to test for the presence of a header before setting its
value.

Parameters:

name the name of the header

value the header value If it contains octet string,
it should be encoded according to RFC 2047
(http://www.ietf.org/rfc/rfc2047.txt)

Sets a response header with the given name and
integer value. If the header had already been set, the new value
overwrites the previous one. The containsHeader
method can be used to test for the presence of a header before
setting its value.

This method is used to set the return status code when there is
no error (for example, for the SC_OK or SC_MOVED_TEMPORARILY status
codes).

If this method is used to set an error code, then the container's
error page mechanism will not be triggered. If there is an error and
the caller wishes to invoke an error page defined in the web
application, then sendError(int) must be used instead.

This method preserves any cookies and other response headers.

Valid status codes are those in the 2XX, 3XX, 4XX, and 5XX ranges.
Other status codes are treated as container specific.

As of version 2.1, due to ambiguous meaning of the
message parameter. To set a status code
use setStatus(int), to send an error with a description
use sendError(int, String).
Sets the status code and message for this response.

Status code (302) indicating that the resource has temporarily
moved to another location, but that future references should
still use the original URI to access the resource.
This definition is being retained for backwards compatibility.
SC_FOUND is now the preferred definition.

Status code (302) indicating that the resource reside
temporarily under a different URI. Since the redirection might
be altered on occasion, the client should continue to use the
Request-URI for future requests.(HTTP/1.1) To represent the
status code (302), it is recommended to use this variable.

Status code (406) indicating that the resource identified by the
request is only capable of generating response entities which have
content characteristics not acceptable according to the accept
headers sent in the request.