|
|||||||||
| Home >> All >> com >> prolifics >> [ servlet overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.prolifics.servlet
Class FilterHttpServletResponse

java.lang.Objectcom.prolifics.servlet.FilterHttpServletResponse
- All Implemented Interfaces:
- javax.servlet.http.HttpServletResponse, javax.servlet.ServletResponse
- public class FilterHttpServletResponse
- extends java.lang.Object
- implements javax.servlet.http.HttpServletResponse
- extends java.lang.Object
An HTTP servlet response. This interface allows a servlet's
service method to manipulate HTTP-protocol specified
header information and return data to its client. It is implemented
by network service developers for use within servlets.
- Version:
- @(#)FilterHttpServletResponse.java 77.1 99/04/22 15:03:04
| Field Summary | |
private javax.servlet.http.HttpServletResponse |
res
|
private static java.lang.String |
sccsid
|
| Constructor Summary | |
FilterHttpServletResponse(javax.servlet.http.HttpServletResponse res)
|
|
| Method Summary | |
void |
addCookie(javax.servlet.http.Cookie cookie)
Adds the specified cookie to the response. |
boolean |
containsHeader(java.lang.String name)
Checks whether the response message header has a field with the specified name. |
java.lang.String |
encodeRedirectUrl(java.lang.String url)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed,
returns the URL unchanged. |
java.lang.String |
encodeRedirectURL(java.lang.String url)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed,
returns the URL unchanged. |
java.lang.String |
encodeUrl(java.lang.String url)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. |
java.lang.String |
encodeURL(java.lang.String url)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. |
java.lang.String |
getCharacterEncoding()
Returns the character set encoding used for this MIME body. |
javax.servlet.ServletOutputStream |
getOutputStream()
Returns an output stream for writing binary response data. |
java.io.PrintWriter |
getWriter()
Returns a print writer for writing formatted text responses. |
void |
sendError(int sc)
Sends an error response to the client using the specified status code and a default message. |
void |
sendError(int sc,
java.lang.String msg)
Sends an error response to the client using the specified status code and descriptive message. |
void |
sendRedirect(java.lang.String location)
Sends a temporary redirect response to the client using the specified redirect location URL. |
void |
setContentLength(int len)
Sets the content length for this response. |
void |
setContentType(java.lang.String type)
Sets the content type for this response. |
void |
setDateHeader(java.lang.String name,
long date)
Adds a field to the response header with the given name and date-valued field. |
void |
setHeader(java.lang.String name,
java.lang.String value)
Adds a field to the response header with the given name and value. |
void |
setIntHeader(java.lang.String name,
int value)
Adds a field to the response header with the given name and integer value. |
void |
setStatus(int sc)
Sets the status code for this response. |
void |
setStatus(int sc,
java.lang.String sm)
Sets the status code and message for this response. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.http.HttpServletResponse |
addDateHeader, addHeader, addIntHeader |
| Methods inherited from interface javax.servlet.ServletResponse |
flushBuffer, getBufferSize, getContentType, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setLocale |
| Field Detail |
sccsid
private static java.lang.String sccsid
res
private javax.servlet.http.HttpServletResponse res
| Constructor Detail |
FilterHttpServletResponse
public FilterHttpServletResponse(javax.servlet.http.HttpServletResponse res)
| Method Detail |
addCookie
public void addCookie(javax.servlet.http.Cookie cookie)
- Adds the specified cookie to the response. It can be called
multiple times to set more than one cookie.
- Specified by:
addCookiein interfacejavax.servlet.http.HttpServletResponse
containsHeader
public boolean containsHeader(java.lang.String name)
- Checks whether the response message header has a field with
the specified name.
- Specified by:
containsHeaderin interfacejavax.servlet.http.HttpServletResponse
setStatus
public void setStatus(int sc,
java.lang.String sm)
- Sets the status code and message for this response. If the
field had already been set, the new value overwrites the
previous one. The message is sent as the body of an HTML
page, which is returned to the user to describe the problem.
The page is sent with a default HTML header; the message
is enclosed in simple body tags (<body></body>).
- Specified by:
setStatusin interfacejavax.servlet.http.HttpServletResponse
setStatus
public void setStatus(int sc)
- Sets the status code for this response. This method is used to
set the return status code when there is no error (for example,
for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there
is an error, the
sendErrormethod should be used instead.- Specified by:
setStatusin interfacejavax.servlet.http.HttpServletResponse
setHeader
public void setHeader(java.lang.String name, java.lang.String value)
- Adds a field to the response header with the given name and value.
If the field had already been set, the new value overwrites the
previous one. The
containsHeadermethod can be used to test for the presence of a header before setting its value.- Specified by:
setHeaderin interfacejavax.servlet.http.HttpServletResponse
setIntHeader
public void setIntHeader(java.lang.String name, int value)
- Adds a field to the response header with the given name and
integer value. If the field had already been set, the new value
overwrites the previous one. The
containsHeadermethod can be used to test for the presence of a header before setting its value.- Specified by:
setIntHeaderin interfacejavax.servlet.http.HttpServletResponse
setDateHeader
public void setDateHeader(java.lang.String name, long date)
- Adds a field to the response header with the given name and
date-valued field. The date is specified in terms of
milliseconds since the epoch. If the date field had already
been set, the new value overwrites the previous one. The
containsHeadermethod can be used to test for the presence of a header before setting its value.- Specified by:
setDateHeaderin interfacejavax.servlet.http.HttpServletResponse
sendError
public void sendError(int sc,
java.lang.String msg)
throws java.io.IOException
- Sends an error response to the client using the specified status
code and descriptive message. If setStatus has previously been
called, it is reset to the error status code. The message is
sent as the body of an HTML page, which is returned to the user
to describe the problem. The page is sent with a default HTML
header; the message is enclosed in simple body tags
(<body></body>).
- Specified by:
sendErrorin interfacejavax.servlet.http.HttpServletResponse
sendError
public void sendError(int sc)
throws java.io.IOException
- Sends an error response to the client using the specified
status code and a default message.
- Specified by:
sendErrorin interfacejavax.servlet.http.HttpServletResponse
sendRedirect
public void sendRedirect(java.lang.String location) throws java.io.IOException
- Sends a temporary redirect response to the client using the
specified redirect location URL. The URL must be absolute (for
example,
https://hostname/path/file.html). Relative URLs are not permitted here.- Specified by:
sendRedirectin interfacejavax.servlet.http.HttpServletResponse
encodeUrl
public java.lang.String encodeUrl(java.lang.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.
- Specified by:
encodeUrlin interfacejavax.servlet.http.HttpServletResponse
encodeURL
public java.lang.String encodeURL(java.lang.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.
- Specified by:
encodeURLin interfacejavax.servlet.http.HttpServletResponse
encodeRedirectUrl
public java.lang.String encodeRedirectUrl(java.lang.String url)
- Encodes the specified URL for use in the
sendRedirectmethod 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 theencodeUrlmethod.All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting canont be used with browsers which do not support cookies.
- Specified by:
encodeRedirectUrlin interfacejavax.servlet.http.HttpServletResponse
encodeRedirectURL
public java.lang.String encodeRedirectURL(java.lang.String url)
- Encodes the specified URL for use in the
sendRedirectmethod 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 theencodeUrlmethod.All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting canont be used with browsers which do not support cookies.
- Specified by:
encodeRedirectURLin interfacejavax.servlet.http.HttpServletResponse
setContentLength
public void setContentLength(int len)
- Sets the content length for this response.
- Specified by:
setContentLengthin interfacejavax.servlet.ServletResponse
setContentType
public void setContentType(java.lang.String type)
- Sets the content type for this response. This type may later
be implicitly modified by addition of properties such as the MIME
charset=<value> if the service finds it necessary,
and the appropriate media type property has not been set.
This response property may only be assigned one time. If a writer is to be used to write a text response, this method must be called before the method
getWriter. If an output stream will be used to write a response, this method must be called before the output stream is used to write response data.- Specified by:
setContentTypein interfacejavax.servlet.ServletResponse
getOutputStream
public javax.servlet.ServletOutputStream getOutputStream() throws java.io.IOException
- Returns an output stream for writing binary response data.
- Specified by:
getOutputStreamin interfacejavax.servlet.ServletResponse
getWriter
public java.io.PrintWriter getWriter() throws java.io.IOException
- Returns a print writer for writing formatted text responses. The
MIME type of the response will be modified, if necessary, to reflect
the character encoding used, through the charset=...
property. This means that the content type must be set before
calling this method.
- Specified by:
getWriterin interfacejavax.servlet.ServletResponse
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- Returns the character set encoding used for this MIME body.
The character encoding is either the one specified in the
assigned content type, or one which the client understands.
If no content type has yet been assigned, it is implicitly
set to text/plain
- Specified by:
getCharacterEncodingin interfacejavax.servlet.ServletResponse
|
|||||||||
| Home >> All >> com >> prolifics >> [ servlet overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.prolifics.servlet.FilterHttpServletResponse