|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.ServletResponseWrapper
javax.servlet.http.HttpServletResponseWrapper
org.mmbase.util.GenericResponseWrapper
Wrapper around the response. It collects all data that is sent to it, and makes it available through a toString() method. It is used by taglib's Include-Tag, but it might find more general use, outside taglib.
| Field Summary | |
static java.lang.String |
TEXT_XML_DEFAULT_CHARSET
|
| Fields inherited from interface javax.servlet.http.HttpServletResponse |
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, 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_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY |
| Constructor Summary | |
GenericResponseWrapper(javax.servlet.http.HttpServletResponse resp)
Public constructor |
|
GenericResponseWrapper(javax.servlet.http.HttpServletResponse resp,
java.lang.String encoding)
Sets also a value for the characterEncoding which must be supposed. |
|
| Method Summary | |
void |
addCookie(javax.servlet.http.Cookie c)
|
protected byte[] |
determinXMLEncoding()
|
java.lang.String |
getCharacterEncoding()
Returns the name of the charset used for the MIME body sent in this response. |
static java.lang.String |
getDefaultEncoding(java.lang.String contentType)
Supposes that no explicit charset is mentioned in a contentType, and returns a default. |
static java.lang.String |
getEncoding(java.lang.String contentType)
Takes the value of a Content-Type header, and tries to find the encoding from it. |
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Gets the response object which this wrapper is wrapping. |
javax.servlet.ServletOutputStream |
getOutputStream()
Return the OutputStream. |
java.io.PrintWriter |
getWriter()
Return the PrintWriter |
static java.lang.String |
getXMLEncoding(byte[] allBytes)
Takes a ByteArrayInputStream, which is considered to be (the first) part of an XML, and returns the encoding. |
static java.lang.String |
getXMLEncoding(java.lang.String xmlString)
Takes a String, which is considered to be (the first) part of an XML, and returns the encoding (the specified one, or the XML default) |
void |
sendRedirect(java.lang.String location)
|
void |
setContentType(java.lang.String ct)
Sets the content type of the response being sent to the client. |
void |
setHeader(java.lang.String header,
java.lang.String value)
|
void |
setStatus(int s)
|
java.lang.String |
toString()
Return all data that has been written to the PrintWriter. |
| Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, setDateHeader, setIntHeader, setStatus |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
flushBuffer, getBufferSize, getLocale, getResponse, isCommitted, reset, resetBuffer, setBufferSize, setContentLength, setLocale, setResponse |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletResponse |
flushBuffer, getBufferSize, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setContentLength, setLocale |
| Field Detail |
public static java.lang.String TEXT_XML_DEFAULT_CHARSET
| Constructor Detail |
public GenericResponseWrapper(javax.servlet.http.HttpServletResponse resp)
public GenericResponseWrapper(javax.servlet.http.HttpServletResponse resp,
java.lang.String encoding)
| Method Detail |
public static final java.lang.String getXMLEncoding(java.lang.String xmlString)
getXMLEncoding(byte[])public static java.lang.String getXMLEncoding(byte[] allBytes)
getXMLEncoding(String)public static java.lang.String getEncoding(java.lang.String contentType)
public static java.lang.String getDefaultEncoding(java.lang.String contentType)
public javax.servlet.http.HttpServletResponse getHttpServletResponse()
public void sendRedirect(java.lang.String location)
throws java.io.IOException
java.io.IOExceptionpublic void setStatus(int s)
public void addCookie(javax.servlet.http.Cookie c)
public void setHeader(java.lang.String header,
java.lang.String value)
public javax.servlet.ServletOutputStream getOutputStream()
throws java.io.IOException
java.io.IOException
public java.io.PrintWriter getWriter()
throws java.io.IOException
java.io.IOExceptionpublic void setContentType(java.lang.String ct)
public java.lang.String getCharacterEncoding()
protected byte[] determinXMLEncoding()
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||