| org.apache.cocoon.environment.Response
All known Subclasses: org.apache.cocoon.environment.mock.MockResponse, org.apache.cocoon.environment.commandline.CommandLineResponse, org.apache.cocoon.environment.wrapper.ResponseWrapper, org.apache.cocoon.environment.http.HttpResponse, org.apache.cocoon.environment.portlet.PortletResponse,
Response | public interface Response (Code) | | Defines an interface to provide client response information .
author: Davanum Srinivas author: Carsten Ziegeler version: CVS $Id: Response.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
void | addCookie(Cookie cookie) Adds the specified cookie to the response. | void | addDateHeader(String name, long date) Adds a response header with the given name and
date-value. | void | addHeader(String name, String value) Adds a response header with the given name and value. | void | addIntHeader(String name, int value) Adds a response header with the given name and
int value. | boolean | containsHeader(String name) Returns a boolean indicating whether the named response header
has already been set. | Cookie | createCookie(String name, String value) Constructs a cookie with a specified name and value.
The name must conform to RFC 2109. | 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 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. | String | getCharacterEncoding() Returns the name of the charset used for
the MIME body sent in this response. | Locale | getLocale() Returns the locale assigned to the response. | void | setDateHeader(String name, long date) Sets a response header with the given name and
date-value. | void | setHeader(String name, String 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. | void | setIntHeader(String name, int value) Sets a response header with the given name and
int value. | void | setLocale(Locale loc) Sets the locale of the response, setting the headers (including the
Content-Type's charset) as appropriate. |
addCookie | void addCookie(Cookie cookie)(Code) | | Adds the specified cookie to the response. This method can be called
multiple times to set more than one cookie.
Parameters: cookie - the Cookie to return to the client |
addDateHeader | void addDateHeader(String name, long date)(Code) | | Adds a response header with the given name and
date-value. The date is specified in terms of
milliseconds since the epoch. This method allows response headers
to have multiple values.
Parameters: name - the name of the header to set Parameters: date - the additional date value See Also: Response.setDateHeader(String,long) |
addHeader | void addHeader(String name, String value)(Code) | | Adds a response header with the given name and value.
This method allows response headers to have multiple values.
Parameters: name - the name of the header Parameters: value - the additional header value See Also: Response.setHeader(String,String) |
addIntHeader | void addIntHeader(String name, int value)(Code) | | Adds a response header with the given name and
int value. This method allows response headers
to have multiple values.
Parameters: name - the name of the header to set Parameters: value - the additional int value See Also: Response.setIntHeader(String,int) |
containsHeader | boolean containsHeader(String name)(Code) | | Returns a boolean indicating whether the named response header
has already been set.
Parameters: name - the header name true if the named response headerhas already been set;false otherwise |
createCookie | Cookie createCookie(String name, String value)(Code) | | Constructs a cookie with a specified name and value.
The name must conform to RFC 2109. That means it can contain
only ASCII alphanumeric characters and cannot contain commas,
semicolons, or white space or begin with a $ character. The cookie's
name cannot be changed after creation.
The value can be anything the server chooses to send. Its
value is probably of interest only to the server. The cookie's
value can be changed after creation with the
setValue method.
By default, cookies are created according to the Netscape
cookie specification. The version can be changed with the
setVersion method.
Parameters: name - a String specifying the name of the cookie Parameters: value - a String specifying the value of the cookie throws: IllegalArgumentException - if the cookie name contains illegal characters(for example, a comma, space, or semicolon)or it is one of the tokens reserved for useby the cookie protocol |
encodeURL | String encodeURL(String url)(Code) | | 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.
Parameters: url - the url to be encoded. the encoded URL if encoding is needed;the unchanged URL otherwise. |
getCharacterEncoding | String getCharacterEncoding()(Code) | | Returns the name of the charset used for
the MIME body sent in this response.
If no charset has been assigned, it is implicitly
set to ISO-8859-1 (Latin-1 ).
See RFC 2047 (http://ds.internic.net/rfc/rfc2045.txt)
for more information about character encoding and MIME.
a String specifying thename of the charset, forexample, ISO-8859-1 |
setDateHeader | void setDateHeader(String name, long date)(Code) | | 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.
Parameters: name - the name of the header to set Parameters: date - the assigned date value See Also: Response.containsHeader(String) See Also: Response.addDateHeader(String,long) |
setHeader | void setHeader(String name, String value)(Code) | | 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 Parameters: value - the header value See Also: Response.containsHeader(String) See Also: Response.addHeader(String,String) |
setIntHeader | void setIntHeader(String name, int value)(Code) | | Sets a response header with the given name and
int 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 to set Parameters: value - the assigned int value See Also: Response.containsHeader(String) See Also: Response.addIntHeader(String,int) |
setLocale | void setLocale(Locale loc)(Code) | | Sets the locale of the response, setting the headers (including the
Content-Type's charset) as appropriate. By default, the response locale
is the default locale for the server.
Parameters: loc - the locale of the response See Also: Response.getLocale() |
|
|