org.displaytag.filter
Class BufferedResponseWrapper13Impl

java.lang.Object
  extended by javax.servlet.ServletResponseWrapper
      extended by javax.servlet.http.HttpServletResponseWrapper
          extended by org.displaytag.filter.BufferedResponseWrapper13Impl
All Implemented Interfaces:
javax.servlet.http.HttpServletResponse, javax.servlet.ServletResponse, BufferedResponseWrapper

public class BufferedResponseWrapper13Impl
extends javax.servlet.http.HttpServletResponseWrapper
implements BufferedResponseWrapper

J2ee 1.3 implementation of BufferedResponseWrapper. Need to extend HttpServletResponseWrapper for Weblogic compatibility.

Version:
$Revision: 1081 $ ($Author: fgiust $)
Author:
rapruitt, Fabrizio Giustina

Field Summary
 
Fields inherited from interface org.displaytag.filter.BufferedResponseWrapper
FILTERED_HEADERS
 
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_FOUND, 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
BufferedResponseWrapper13Impl(javax.servlet.http.HttpServletResponse httpServletResponse)
           
 
Method Summary
 void addDateHeader(java.lang.String name, long date)
           
 void addHeader(java.lang.String name, java.lang.String value)
           
 void addIntHeader(java.lang.String name, int value)
           
 void flushBuffer()
          Flush the buffer, not the response.
 java.lang.String getContentAsString()
          Returns the String representation of the content written to the response.
 java.lang.String getContentType()
          If the app server sets the content-type of the response, it is sticky and you will not be able to change it.
 javax.servlet.ServletOutputStream getOutputStream()
           
 java.io.PrintWriter getWriter()
           
 boolean isOutRequested()
          Return true if ServletOutputStream has been requested from Table tag.
 void setContentType(java.lang.String theContentType)
          The content type is NOT set on the wrapped response.
 void setDateHeader(java.lang.String name, long date)
           
 void setHeader(java.lang.String name, java.lang.String value)
           
 void setIntHeader(java.lang.String name, int value)
           
 
Methods inherited from class javax.servlet.http.HttpServletResponseWrapper
addCookie, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, sendRedirect, setStatus, setStatus
 
Methods inherited from class javax.servlet.ServletResponseWrapper
getBufferSize, getCharacterEncoding, getLocale, getResponse, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, 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.http.HttpServletResponse
addCookie, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, sendRedirect, setStatus, setStatus
 
Methods inherited from interface javax.servlet.ServletResponse
getBufferSize, getCharacterEncoding, getLocale, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setLocale
 

Constructor Detail

BufferedResponseWrapper13Impl

public BufferedResponseWrapper13Impl(javax.servlet.http.HttpServletResponse httpServletResponse)
Parameters:
httpServletResponse - the response to wrap
Method Detail

getContentType

public java.lang.String getContentType()
Description copied from interface: BufferedResponseWrapper
If the app server sets the content-type of the response, it is sticky and you will not be able to change it. Therefore it is intercepted here.

Specified by:
getContentType in interface javax.servlet.ServletResponse
Specified by:
getContentType in interface BufferedResponseWrapper
Overrides:
getContentType in class javax.servlet.ServletResponseWrapper
Returns:
the ContentType that was most recently set
See Also:
BufferedResponseWrapper.getContentType()

setContentType

public void setContentType(java.lang.String theContentType)
The content type is NOT set on the wrapped response. You must set it manually. Overrides any previously set value.

Specified by:
setContentType in interface javax.servlet.ServletResponse
Overrides:
setContentType in class javax.servlet.ServletResponseWrapper
Parameters:
theContentType - the content type.

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Specified by:
getWriter in interface javax.servlet.ServletResponse
Overrides:
getWriter in class javax.servlet.ServletResponseWrapper
Throws:
java.io.IOException
See Also:
ServletResponse.getWriter()

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Flush the buffer, not the response.

Specified by:
flushBuffer in interface javax.servlet.ServletResponse
Overrides:
flushBuffer in class javax.servlet.ServletResponseWrapper
Throws:
java.io.IOException - if encountered when flushing

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()
                                                  throws java.io.IOException
Specified by:
getOutputStream in interface javax.servlet.ServletResponse
Overrides:
getOutputStream in class javax.servlet.ServletResponseWrapper
Throws:
java.io.IOException
See Also:
ServletResponse.getOutputStream()

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Specified by:
addHeader in interface javax.servlet.http.HttpServletResponse
Overrides:
addHeader in class javax.servlet.http.HttpServletResponseWrapper
See Also:
HttpServletResponse.addHeader(java.lang.String, java.lang.String)

isOutRequested

public boolean isOutRequested()
Description copied from interface: BufferedResponseWrapper
Return true if ServletOutputStream has been requested from Table tag.

Specified by:
isOutRequested in interface BufferedResponseWrapper
Returns:
true if ServletOutputStream has been requested
See Also:
BufferedResponseWrapper.isOutRequested()

getContentAsString

public java.lang.String getContentAsString()
Description copied from interface: BufferedResponseWrapper
Returns the String representation of the content written to the response.

Specified by:
getContentAsString in interface BufferedResponseWrapper
Returns:
the content of the response
See Also:
BufferedResponseWrapper.getContentAsString()

setDateHeader

public void setDateHeader(java.lang.String name,
                          long date)
Specified by:
setDateHeader in interface javax.servlet.http.HttpServletResponse
Overrides:
setDateHeader in class javax.servlet.http.HttpServletResponseWrapper
See Also:
HttpServletResponse.setDateHeader(java.lang.String, long)

addDateHeader

public void addDateHeader(java.lang.String name,
                          long date)
Specified by:
addDateHeader in interface javax.servlet.http.HttpServletResponse
Overrides:
addDateHeader in class javax.servlet.http.HttpServletResponseWrapper
See Also:
HttpServletResponse.addDateHeader(java.lang.String, long)

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Specified by:
setHeader in interface javax.servlet.http.HttpServletResponse
Overrides:
setHeader in class javax.servlet.http.HttpServletResponseWrapper
See Also:
HttpServletResponse.setHeader(java.lang.String, java.lang.String)

setIntHeader

public void setIntHeader(java.lang.String name,
                         int value)
Specified by:
setIntHeader in interface javax.servlet.http.HttpServletResponse
Overrides:
setIntHeader in class javax.servlet.http.HttpServletResponseWrapper
See Also:
HttpServletResponse.setIntHeader(java.lang.String, int)

addIntHeader

public void addIntHeader(java.lang.String name,
                         int value)
Specified by:
addIntHeader in interface javax.servlet.http.HttpServletResponse
Overrides:
addIntHeader in class javax.servlet.http.HttpServletResponseWrapper
See Also:
HttpServletResponse.addIntHeader(java.lang.String, int)


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.