|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object echopoint.servlet.CompressingHttpServletResponse
CompressingHttpServletResponse
is HttpServletResponse
that can compress data back to the client browser if
it indicates that it can accept encoded data. It will only
encode text data (eg "Content-Type" "text/html" or "text/javascript")
Other data, such as image data, is typically compressed and does not need more compression. In fact testing has shown that compression image data can increase it size and interfere with the client browsers ability to render it.
The standard java.util.zip.GZIPOutputStream compression code is used and the "Content-Encoding" will be set to "gzip".
Field Summary |
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 | |
protected |
CompressingHttpServletResponse(javax.servlet.http.HttpServletResponse response,
boolean areBytesAccumulated)
Constructs a CompressingHttpServletResponse that
compresses the data that is returned by a HttpServletResponse. |
Method Summary | |
void |
addCookie(javax.servlet.http.Cookie arg0)
|
void |
addDateHeader(java.lang.String arg0,
long arg1)
|
void |
addHeader(java.lang.String arg0,
java.lang.String arg1)
|
void |
addIntHeader(java.lang.String arg0,
int arg1)
|
boolean |
containsHeader(java.lang.String arg0)
|
java.lang.String |
encodeRedirectUrl(java.lang.String arg0)
Deprecated. |
java.lang.String |
encodeRedirectURL(java.lang.String arg0)
|
java.lang.String |
encodeUrl(java.lang.String arg0)
Deprecated. |
java.lang.String |
encodeURL(java.lang.String arg0)
|
boolean |
equals(java.lang.Object obj)
|
void |
flushBuffer()
|
int |
getBufferSize()
|
java.lang.String |
getCharacterEncoding()
|
static javax.servlet.http.HttpServletResponse |
getInstance(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This methods returns a HttpServletResponse that may compress the data that is sent back to the browser. |
java.util.Locale |
getLocale()
|
javax.servlet.ServletOutputStream |
getOutputStream()
|
java.io.PrintWriter |
getWriter()
|
int |
hashCode()
|
boolean |
isCommitted()
|
void |
reset()
|
void |
resetBuffer()
|
void |
sendError(int arg0)
|
void |
sendError(int arg0,
java.lang.String arg1)
|
void |
sendRedirect(java.lang.String arg0)
|
void |
setBufferSize(int arg0)
|
void |
setContentLength(int contentLength)
|
void |
setContentType(java.lang.String contentType)
|
void |
setDateHeader(java.lang.String arg0,
long arg1)
|
void |
setHeader(java.lang.String arg0,
java.lang.String arg1)
|
void |
setIntHeader(java.lang.String arg0,
int arg1)
|
void |
setLocale(java.util.Locale arg0)
|
void |
setStatus(int arg0)
|
void |
setStatus(int arg0,
java.lang.String arg1)
Deprecated. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected CompressingHttpServletResponse(javax.servlet.http.HttpServletResponse response, boolean areBytesAccumulated)
CompressingHttpServletResponse
that
compresses the data that is returned by a HttpServletResponse.
response
- - the HttpServletResponse to compress data forareBytesAccumulated
- - indicates whether bytes should be accumulated
in memory first so that the "Content-Length" header can be accurately set.
This is generally not needed in most browsers.Method Detail |
public static javax.servlet.http.HttpServletResponse getInstance(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
response
is passed back unchanged.
request
- - the original HttpServletRequestresponse
- - the original HttpServletResponse
public javax.servlet.ServletOutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface javax.servlet.ServletResponse
java.io.IOException
ServletResponse.getOutputStream()
public void setContentLength(int contentLength)
setContentLength
in interface javax.servlet.ServletResponse
ServletResponse.setContentLength(int)
public void setContentType(java.lang.String contentType)
setContentType
in interface javax.servlet.ServletResponse
ServletResponse.setContentType(java.lang.String)
public void setBufferSize(int arg0)
setBufferSize
in interface javax.servlet.ServletResponse
ServletResponse.setBufferSize(int)
public void flushBuffer() throws java.io.IOException
flushBuffer
in interface javax.servlet.ServletResponse
java.io.IOException
ServletResponse.flushBuffer()
public int getBufferSize()
getBufferSize
in interface javax.servlet.ServletResponse
ServletResponse.getBufferSize()
public java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
in interface javax.servlet.ServletResponse
java.io.IOException
ServletResponse.getWriter()
public void addCookie(javax.servlet.http.Cookie arg0)
addCookie
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.addCookie(javax.servlet.http.Cookie)
public void addDateHeader(java.lang.String arg0, long arg1)
addDateHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.addDateHeader(java.lang.String, long)
public void addHeader(java.lang.String arg0, java.lang.String arg1)
addHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.addHeader(java.lang.String, java.lang.String)
public void addIntHeader(java.lang.String arg0, int arg1)
addIntHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.addIntHeader(java.lang.String, int)
public boolean containsHeader(java.lang.String arg0)
containsHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.containsHeader(java.lang.String)
public java.lang.String encodeRedirectUrl(java.lang.String arg0)
encodeRedirectUrl
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.encodeRedirectUrl(java.lang.String)
public java.lang.String encodeRedirectURL(java.lang.String arg0)
encodeRedirectURL
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.encodeRedirectURL(java.lang.String)
public java.lang.String encodeUrl(java.lang.String arg0)
encodeUrl
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.encodeUrl(java.lang.String)
public java.lang.String encodeURL(java.lang.String arg0)
encodeURL
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.encodeURL(java.lang.String)
public boolean equals(java.lang.Object obj)
Object.equals(java.lang.Object)
public java.lang.String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletResponse
ServletResponse.getCharacterEncoding()
public java.util.Locale getLocale()
getLocale
in interface javax.servlet.ServletResponse
ServletResponse.getLocale()
public int hashCode()
Object.hashCode()
public boolean isCommitted()
isCommitted
in interface javax.servlet.ServletResponse
ServletResponse.isCommitted()
public void reset()
reset
in interface javax.servlet.ServletResponse
ServletResponse.reset()
public void resetBuffer()
resetBuffer
in interface javax.servlet.ServletResponse
ServletResponse.resetBuffer()
public void sendError(int arg0) throws java.io.IOException
sendError
in interface javax.servlet.http.HttpServletResponse
java.io.IOException
HttpServletResponse.sendError(int)
public void sendError(int arg0, java.lang.String arg1) throws java.io.IOException
sendError
in interface javax.servlet.http.HttpServletResponse
java.io.IOException
HttpServletResponse.sendError(int, java.lang.String)
public void sendRedirect(java.lang.String arg0) throws java.io.IOException
sendRedirect
in interface javax.servlet.http.HttpServletResponse
java.io.IOException
HttpServletResponse.sendRedirect(java.lang.String)
public void setDateHeader(java.lang.String arg0, long arg1)
setDateHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.setDateHeader(java.lang.String, long)
public void setHeader(java.lang.String arg0, java.lang.String arg1)
setHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.setHeader(java.lang.String, java.lang.String)
public void setIntHeader(java.lang.String arg0, int arg1)
setIntHeader
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.setIntHeader(java.lang.String, int)
public void setLocale(java.util.Locale arg0)
setLocale
in interface javax.servlet.ServletResponse
ServletResponse.setLocale(java.util.Locale)
public void setStatus(int arg0)
setStatus
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.setStatus(int)
public void setStatus(int arg0, java.lang.String arg1)
setStatus
in interface javax.servlet.http.HttpServletResponse
HttpServletResponse.setStatus(int, java.lang.String)
public java.lang.String toString()
Object.toString()
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |