|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.ServletResponseWrapper javax.servlet.http.HttpServletResponseWrapper net.sf.click.extras.filter.CompressionServletResponseWrapper
Implementation of HttpServletResponseWrapper that works with the CompressionServletResponseStream implementation.
Note this Jakarta Tomcat examples Filter is packaged in Click Extras for convenience.
Field Summary | |
protected String |
contentType
Content type. |
protected static String |
INFO
Descriptive information about this Response implementation. |
protected HttpServletResponse |
origResponse
Original response. |
protected ServletOutputStream |
stream
The ServletOutputStream that has been returned by getOutputStream() , if any. |
protected int |
threshold
The threshold number to compress. |
protected PrintWriter |
writer
The PrintWriter that has been returned by getWriter() , if any. |
Constructor Summary | |
CompressionServletResponseWrapper(HttpServletResponse response)
Calls the parent constructor which creates a ServletResponse adaptor wrapping the given response object. |
Method Summary | |
ServletOutputStream |
createOutputStream()
Create and return a ServletOutputStream to write the content associated with this Response. |
void |
finishResponse()
Finish a response. |
void |
flushBuffer()
Flush the buffer and commit this response. |
ServletOutputStream |
getOutputStream()
Return the servlet output stream associated with this Response. |
PrintWriter |
getWriter()
Return the writer associated with this Response. |
void |
setCompressionThreshold(int threshold)
Set threshold the compression threshold in bytes. |
void |
setContentLength(int length)
Set the content length. |
void |
setContentType(String contentType)
Set content type. |
void |
setHeader(String header,
String value)
Set the string value in the header. |
void |
setIntHeader(String header,
int value)
Set the int value in the header. |
Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, sendRedirect, setDateHeader, setStatus, setStatus |
Methods inherited from class javax.servlet.ServletResponseWrapper |
getBufferSize, getCharacterEncoding, getLocale, getResponse, isCommitted, reset, resetBuffer, setBufferSize, setLocale, setResponse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletResponse |
getBufferSize, getCharacterEncoding, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setLocale |
Field Detail |
protected HttpServletResponse origResponse
protected static final String INFO
protected ServletOutputStream stream
getOutputStream()
, if any.
protected PrintWriter writer
getWriter()
, if any.
protected int threshold
protected String contentType
Constructor Detail |
public CompressionServletResponseWrapper(HttpServletResponse response)
response
- the servlet response to wrapMethod Detail |
public void setContentType(String contentType)
contentType
- the response content typepublic void setCompressionThreshold(int threshold)
threshold
- the compression threshold in bytespublic ServletOutputStream createOutputStream() throws IOException
IOException
- if an input/output error occurspublic void finishResponse()
public void flushBuffer() throws IOException
IOException
- if an input/output error occurspublic ServletOutputStream getOutputStream() throws IOException
IllegalStateException
- if getWriter
has
already been called for this response
IOException
- if an input/output error occurspublic PrintWriter getWriter() throws IOException
IllegalStateException
- if getOutputStream
has
already been called for this response
IOException
- if an input/output error occurspublic void setContentLength(int length)
length
- the content lengthpublic void setIntHeader(String header, int value)
header
- the response headervalue
- the int valuepublic void setHeader(String header, String value)
header
- the response headervalue
- the string value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |