atg.servlet
Class DynamoHttpServletResponse

java.lang.Object
  extended by atg.servlet.DynamoHttpServletResponse
All Implemented Interfaces:
AddHeaderHttpServletResponse, atg.servlet.CharacterEncodable, javax.servlet.http.HttpServletResponse, javax.servlet.ServletResponse

public class DynamoHttpServletResponse
extends java.lang.Object
implements javax.servlet.http.HttpServletResponse, AddHeaderHttpServletResponse, atg.servlet.CharacterEncodable

This object implements an extended version of javax.servlet.http.HttpServletResponse. It includes additional functionality for

This object is created from a regular javax.servlet.http.HttpServletResponse which you can get and set.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String REQUEST_ID
          Name of the query parameter to use to store the request id on redirects
 
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
DynamoHttpServletResponse()
          Constructs a new wrapper javax.servlet.http.HttpServletResponse wrapper
DynamoHttpServletResponse(javax.servlet.http.HttpServletResponse pResponse)
          Constructs a new wrapper javax.servlet.http.HttpServletResponse wrapper
 
Method Summary
 void addCookie(javax.servlet.http.Cookie cookie)
          Uses the given HTTP response message to assign a new value to a browser-specific cookie.
 void addCookieToBuffer(javax.servlet.http.Cookie pCookie)
          Adds a cookie to the CookieBuffer.
 void addDateHeader(java.lang.String pName, long pValue)
          Adds a field to the response header with a given name and date-valued field.
 void addHeader(java.lang.String pName, java.lang.String pValue)
          Adds a field to the response header with a given name and value.
 void addIntHeader(java.lang.String pName, int pValue)
          Adds a field to the response header with a given name and integer value.
 boolean containsHeader(java.lang.String pName)
          Returns true if the response message header has a field with the specified name.
 java.lang.String encodeRedirectUrl(java.lang.String url)
          Deprecated.  
 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)
          Deprecated.  
 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.
 void flushBuffer()
          Forces any content in the buffer to be written to the client.
 int getBufferSize()
          Returns the actual buffer size used for the response.
 java.lang.String getCharacterEncoding()
          Returns the character encoding used for writing text to the body of this response.
 java.lang.String getContentType()
          Gets the content type for this response.
 boolean getContentTypeSet()
           
 boolean getDoExitTracking()
           
 java.util.Dictionary getHeaders()
          Returns a Dictionary of the headers that have been set so far.
 java.util.Enumeration getHeaders(java.lang.String pHeaderName)
          Returns all the values of the specified request header as an Enumeration of objects.
 java.util.Locale getLocale()
          Returns the locale assigned to the response.
 atg.servlet.LocaleToCharsetMapper getLocaleToCharsetMapper()
          Returns the LocaleToCharsetMapper property
 javax.servlet.ServletOutputStream getOutputStream()
          Returns an output stream for writing response data.
 javax.servlet.http.HttpServletResponse getResponse()
          Returns the HttpServletResponse property
 int getStatus()
          Returns the status code sent through this response object.
 javax.servlet.ServletResponseWrapper getWrapper()
          Returns the ServletResponseWrapper wrapping this request.
 java.io.PrintWriter getWriter()
          Returns the print writer for writing text response data
 boolean isCommitted()
          Returns a boolean indicating if the response has been committed.
 boolean isOutputStreamRetrieved()
           
 boolean isOutputStreamUsed()
          Returns true if the servlet output stream has been set or used in this request
 boolean isResponseComplete()
          Returns true if we know that a complete response has already been sent.
 boolean isWriterUsed()
          Returns true if the print writer has been set or used in this request
 void reset()
          Clears any data that exists in the buffer as well as the status code and headers.
 void resetBuffer()
          Clears the content of the underlying buffer in the response without clearing headers or status code.
 void sendError(int pCode)
          Sends an error response to the client using the specified status code and a default message.
 void sendError(int pCode, java.lang.String pMessage)
          Sends an error response to the client using the specified status code and descriptive message.
 void sendLocalRedirect(java.lang.String pLocation, DynamoHttpServletRequest pRequest)
          Sends a redirect response to the client using the specified redirect location URL.
 void sendRedirect(java.lang.String pLocation)
          Sends a redirect response to the client using the specified redirect location URL.
static void setAllowChangeHeadersDuringInclude(boolean pAllow)
          Method to allow/disallow changing headers on the response during an include.
 void setBufferSize(int pBufferSize)
          Sets the preferred buffer size for the body of the response.
 void setCharacterEncoding(java.lang.String pCharset)
           
 void setContentLength(int pLength)
          Sets the content length for this response.
 void setContentType(java.lang.String pContentType)
          Sets the content type for this response.
 void setContentTypeSet(boolean pContentTypeSet)
          Sets the property ContentTypeSet.
 void setDateHeader(java.lang.String pName, long pValue)
          Adds a field to the response header with a given name and date-valued field.
 void setDoExitTracking(boolean pDoExitTracking)
          Sets the property doExitTracking.
 void setHeader(java.lang.String pName, java.lang.String pValue)
          Adds a field to the response header with a given name and value.
 void setIntHeader(java.lang.String pName, int pValue)
          Adds a field to the response header with a given name and integer value.
 void setLocale(java.util.Locale pLocale)
          Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate.
 void setLocaleToCharsetMapper(atg.servlet.LocaleToCharsetMapper pMapper)
          Sets the LocaleToCharsetMapper property
 void setOutputStream(javax.servlet.ServletOutputStream pOutputStream)
          Sets the output stream property.
 void setRequest(DynamoHttpServletRequest pRequest)
          Sets the servlet request corresponding to the response for this method.
 void setResponse(javax.servlet.http.HttpServletResponse pResponse)
          Sets the HttpServletResponse property
 void setStatus(int pCode)
          Sets the status code and a default message for this response.
 void setStatus(int pCode, java.lang.String pMessage)
          Deprecated.  
 boolean setStrictOutputAccess(boolean pStrict)
          StrictOutputAccess controls whether the Servlet 2.2 behavior of restricting access to PrintWriters and OuputStreams is imposed.
 void setWrapper(javax.servlet.ServletResponseWrapper pWrapper)
          Sets the ServletResponseWrapper wrapping this request.
 void setWriter(java.io.PrintWriter pWriter)
          Sets the writer for use by subsequent requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


REQUEST_ID

public static final java.lang.String REQUEST_ID
Name of the query parameter to use to store the request id on redirects

See Also:
Constant Field Values
Constructor Detail

DynamoHttpServletResponse

public DynamoHttpServletResponse()
Constructs a new wrapper javax.servlet.http.HttpServletResponse wrapper


DynamoHttpServletResponse

public DynamoHttpServletResponse(javax.servlet.http.HttpServletResponse pResponse)
Constructs a new wrapper javax.servlet.http.HttpServletResponse wrapper

Parameters:
pResponse - the instance being wrapped
Method Detail

setResponse

public void setResponse(javax.servlet.http.HttpServletResponse pResponse)
Sets the HttpServletResponse property


setRequest

public void setRequest(DynamoHttpServletRequest pRequest)
Sets the servlet request corresponding to the response for this method.


getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Returns the HttpServletResponse property


setLocaleToCharsetMapper

public void setLocaleToCharsetMapper(atg.servlet.LocaleToCharsetMapper pMapper)
Sets the LocaleToCharsetMapper property


getLocaleToCharsetMapper

public atg.servlet.LocaleToCharsetMapper getLocaleToCharsetMapper()
Returns the LocaleToCharsetMapper property


setOutputStream

public void setOutputStream(javax.servlet.ServletOutputStream pOutputStream)
Sets the output stream property. This method should be used with care, and whether to also call setWriter should be considered.


setWriter

public void setWriter(java.io.PrintWriter pWriter)
Sets the writer for use by subsequent requests. Writers are used when the characters sent to the browser are different than the simple unicode representation (i.e. not us-ascii). This method should be used with care.


setStrictOutputAccess

public boolean setStrictOutputAccess(boolean pStrict)
StrictOutputAccess controls whether the Servlet 2.2 behavior of restricting access to PrintWriters and OuputStreams is imposed.

Returns:
the old value for strictOutputAccess.

getHeaders

public java.util.Dictionary getHeaders()
Returns a Dictionary of the headers that have been set so far. String headers will have values of Strings, int headers will have values of Integers, and date headers will have values of Longs.


getHeaders

public java.util.Enumeration getHeaders(java.lang.String pHeaderName)
Returns all the values of the specified request header as an Enumeration of objects. The objects returned may be a Strings, Integers, or Longs, depending on whether setHeader, setIntHeader, or setDateHeader was used.

Some headers, such as Set-Cookie can be sent to clients as several headers each with a different value rather than sending the header as a comma separated list.

If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.

Parameters:
pHeaderName - a String specifying the header name
Returns:
a Enumeration containing the values of the requested header, or an empty Enumeration if the request does not have any headers of that name.

setContentLength

public void setContentLength(int pLength)
Sets the content length for this response.

Specified by:
setContentLength in interface javax.servlet.ServletResponse
Parameters:
pLength - the content length

setContentType

public void setContentType(java.lang.String pContentType)
Sets the content type for this response. Depending on the content type the appropriate URL SessionID Specifier is set.

Specified by:
setContentType in interface javax.servlet.ServletResponse
Parameters:
the - content's MIME type

getContentType

public java.lang.String getContentType()
Gets the content type for this response.

Specified by:
getContentType in interface javax.servlet.ServletResponse
Parameters:
the - content's MIME type

setContentTypeSet

public void setContentTypeSet(boolean pContentTypeSet)
Sets the property ContentTypeSet. This property indicates whether or not the content type of the response has been set to correspond to the file. It is used to implement a performance optimization to avoid setting this multiple times when doing recursive include of the PageCompileServlet. This value gets set to false when the request starts and also when the response is reset. It gets set to true in the PageCompileServlet when the content type is defined and if it is true, prevents the PageCompileServlet from setting this and the dynamic content type header again.

Parameters:
pContentTypeSet - new value to set

getContentTypeSet

public boolean getContentTypeSet()
Returns:
The value of the property ContentTypeSet.

setDoExitTracking

public void setDoExitTracking(boolean pDoExitTracking)
Sets the property doExitTracking. This property indicates whether or not exit tracking should be done during sendLocalRedirect.

Parameters:
pDoExitTracking - new value to set

getDoExitTracking

public boolean getDoExitTracking()
Returns:
The value of the property doExitTracking.

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()
                                                  throws java.io.IOException
Returns an output stream for writing response data.

Specified by:
getOutputStream in interface javax.servlet.ServletResponse
Throws:
java.io.IOException - if an I/O exception has occurred

containsHeader

public boolean containsHeader(java.lang.String pName)
Returns true if the response message header has a field with the specified name.

Specified by:
containsHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header field name

setStatus

public void setStatus(int pCode,
                      java.lang.String pMessage)
Deprecated. 

Sets the status code and message for this response.

Specified by:
setStatus in interface javax.servlet.http.HttpServletResponse
Parameters:
pCode - the status code
pMessage - the status message

setStatus

public void setStatus(int pCode)
Sets the status code and a default message for this response.

Specified by:
setStatus in interface javax.servlet.http.HttpServletResponse
Parameters:
pCode - the status code

getStatus

public int getStatus()
Returns the status code sent through this response object. If no status code has been set explicitly, SC_STATUS_OK is sent.


setHeader

public void setHeader(java.lang.String pName,
                      java.lang.String pValue)
Adds a field to the response header with a given name and value. If the field had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
setHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header name
pValue - the header value

addHeader

public void addHeader(java.lang.String pName,
                      java.lang.String pValue)
Adds a field to the response header with a given name and value. If the field has already been set, then an additional header is created for the new value. The containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
addHeader in interface AddHeaderHttpServletResponse
Specified by:
addHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header name
pValue - the header value

setIntHeader

public void setIntHeader(java.lang.String pName,
                         int pValue)
Adds a field to the response header with a given name and integer value. If the field had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
setIntHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header name
pValue - the header value

addIntHeader

public void addIntHeader(java.lang.String pName,
                         int pValue)
Adds a field to the response header with a given name and integer value. If the field has already been set, then an additional header is created for the new value. The containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
addIntHeader in interface AddHeaderHttpServletResponse
Specified by:
addIntHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header name
pValue - the header value

setDateHeader

public void setDateHeader(java.lang.String pName,
                          long pValue)
Adds a field to the response header with a 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 containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
setDateHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header name
pValue - the header value

addDateHeader

public void addDateHeader(java.lang.String pName,
                          long pValue)
Adds a field to the response header with a given name and date-valued field. The date is specified in terms of milliseconds since the epoch. If the field has already been set, then an additional header is created for the new value. The containsHeader method can be used to test for the presence of a header before setting its value.

Specified by:
addDateHeader in interface AddHeaderHttpServletResponse
Specified by:
addDateHeader in interface javax.servlet.http.HttpServletResponse
Parameters:
pName - the header name
pValue - the header value

sendError

public void sendError(int pCode,
                      java.lang.String pMessage)
               throws java.io.IOException
Sends an error response to the client using the specified status code and descriptive message.

Specified by:
sendError in interface javax.servlet.http.HttpServletResponse
Parameters:
pCode - the status code
pMessage - the detail message
Throws:
java.io.IOException - If an I/O error has occurred.

sendError

public void sendError(int pCode)
               throws java.io.IOException
Sends an error response to the client using the specified status code and a default message.

Specified by:
sendError in interface javax.servlet.http.HttpServletResponse
Parameters:
pCode - the status code
Throws:
java.io.IOException - If an I/O error has occurred.

sendRedirect

public void sendRedirect(java.lang.String pLocation)
                  throws java.io.IOException
Sends a redirect response to the client using the specified redirect location URL.

Servlet 2.3 requires that this method handle relative URLs so that's what we do when running in the DAS J2EE container. Here's how it says we're supposed to handle things:

  • If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root.
  • If a partial URL is given and, for whatever reason, cannot be converted into a valid URL, then this method must throw an IllegalArgumentException.
  • If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

If we're not in DAS-J2EE then the URL must be absolute (e.g., https://hostname/path/file.html). Relative URLs are not permitted here.

Specified by:
sendRedirect in interface javax.servlet.http.HttpServletResponse
Parameters:
pLocation - the redirect location URL
Throws:
java.io.IOException - If an I/O error has occurred.

encodeUrl

public java.lang.String encodeUrl(java.lang.String url)
Deprecated. 

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:
encodeUrl in interface javax.servlet.http.HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.
See Also:
encodeURL(java.lang.String)

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:
encodeURL in interface javax.servlet.http.HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

encodeRedirectUrl

public java.lang.String encodeRedirectUrl(java.lang.String url)
Deprecated. 

Encodes the specified URL for use in the sendRedirect method 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 the encodeUrl method.

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:
encodeRedirectUrl in interface javax.servlet.http.HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.
See Also:
encodeRedirectURL(java.lang.String)

encodeRedirectURL

public 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. 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 the encodeUrl method.

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:
encodeRedirectURL in interface javax.servlet.http.HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.
See Also:
sendRedirect(java.lang.String), encodeURL(java.lang.String)

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Returns the print writer for writing text response data

Specified by:
getWriter in interface javax.servlet.ServletResponse
Throws:
java.io.IOException

isWriterUsed

public boolean isWriterUsed()
Returns true if the print writer has been set or used in this request


isOutputStreamUsed

public boolean isOutputStreamUsed()
Returns true if the servlet output stream has been set or used in this request


getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the character encoding used for writing text to the body of this response. This is based on the current content type of the response (using the ; charset=xxx) value.

Specified by:
getCharacterEncoding in interface atg.servlet.CharacterEncodable
Specified by:
getCharacterEncoding in interface javax.servlet.ServletResponse

addCookie

public void addCookie(javax.servlet.http.Cookie cookie)
Uses the given HTTP response message to assign a new value to a browser-specific cookie. Updates the response to restrict caching of sensitive cookie-related data.

Specified by:
addCookie in interface javax.servlet.http.HttpServletResponse

addCookieToBuffer

public void addCookieToBuffer(javax.servlet.http.Cookie pCookie)
Adds a cookie to the CookieBuffer. See atg.servlet.http.CookieBuffer


sendLocalRedirect

public void sendLocalRedirect(java.lang.String pLocation,
                              DynamoHttpServletRequest pRequest)
                       throws java.io.IOException
Sends a redirect response to the client using the specified redirect location URL. This function is similar to sendRedirect(), with the following two differences:
  • The session ID is added to the URL if a valid cookie with the session ID is not found.
  • If the URL is a relative URL (i.e., "login/error.html"), then the URL will be converted to a full absolute URL, as required by the HTTP specification. A relative URL is one that does not specify a protocol (e.g., "http:").

In general, this function should be used when redirecting back to a page on the same site. If you are redirecting to a page on some other site, use the full absolute URL and call sendRedirect().

Parameters:
pLocation - the location to send as a redirect
pRequest - the request containing the URI of the current request, used when converting relative URL's to absolute URL's.
Throws:
java.io.IOException
See Also:
sendRedirect(java.lang.String)

isResponseComplete

public boolean isResponseComplete()
Returns true if we know that a complete response has already been sent. This is typically only true if a redirect has been sent through this response.


getBufferSize

public int getBufferSize()
Returns the actual buffer size used for the response. If no buffering is used, this method returns 0.

Specified by:
getBufferSize in interface javax.servlet.ServletResponse
Returns:
the actual buffer size used
See Also:
setBufferSize(int), flushBuffer(), isCommitted(), reset()

setBufferSize

public void setBufferSize(int pBufferSize)
Sets the preferred buffer size for the body of the response. The servlet container will use a buffer at least as large as the size requested. The actual buffer size used can be found using getBufferSize.

A larger buffer allows more content to be written before anything is actually sent, thus providing the servlet with more time to set appropriate status codes and headers. A smaller buffer decreases server memory load and allows the client to start receiving data more quickly. This method must be called before any response body content is written; if content has been written, this method throws an IllegalStateException.

Specified by:
setBufferSize in interface javax.servlet.ServletResponse
Parameters:
pBufferSize - the preferred buffer size
Throws:
java.lang.IllegalStateException - if this method is called after content has been written
See Also:
getBufferSize(), flushBuffer(), isCommitted(), reset()

isCommitted

public boolean isCommitted()
Returns a boolean indicating if the response has been committed. A commited response has already had its status code and headers written.

Specified by:
isCommitted in interface javax.servlet.ServletResponse
Returns:
a boolean indicating if the response has been committed
See Also:
getBufferSize(), flushBuffer(), setBufferSize(int), reset()

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Forces any content in the buffer to be written to the client. A call to this method automatically commits the response, meaning the status code and headers will be written.

Specified by:
flushBuffer in interface javax.servlet.ServletResponse
Throws:
java.io.IOException
See Also:
getBufferSize(), isCommitted(), setBufferSize(int), reset()

reset

public void reset()
Clears any data that exists in the buffer as well as the status code and headers. If the response has been committed, this method throws an IllegalStateException.

Specified by:
reset in interface javax.servlet.ServletResponse
Throws:
java.lang.IllegalStateException - if the response has already been committed
See Also:
getBufferSize(), flushBuffer(), setBufferSize(int), isCommitted()

resetBuffer

public void resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code. If the response has been committed, this method throws an IllegalStateException.

Specified by:
resetBuffer in interface javax.servlet.ServletResponse
Since:
2.3
See Also:
setBufferSize(int), getBufferSize(), isCommitted(), reset()

getLocale

public java.util.Locale getLocale()
Returns the locale assigned to the response.

Specified by:
getLocale in interface javax.servlet.ServletResponse
See Also:
setLocale(java.util.Locale)

setLocale

public void setLocale(java.util.Locale pLocale)
Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate. This method should be called before a call to #getWriter. By default, the response locale is the default locale for the server.

Specified by:
setLocale in interface javax.servlet.ServletResponse
Parameters:
pLocale - the locale of the response
See Also:
getLocale()

getWrapper

public javax.servlet.ServletResponseWrapper getWrapper()
Returns the ServletResponseWrapper wrapping this request. If there are multiple wrappers created in the course of executing the pipeline or filter chain this should be the outermost such wrapper.


setWrapper

public void setWrapper(javax.servlet.ServletResponseWrapper pWrapper)
Sets the ServletResponseWrapper wrapping this request. If there are multiple wrappers created in the course of executing the pipeline or filter chain this should be the outermost such wrapper.


setAllowChangeHeadersDuringInclude

public static void setAllowChangeHeadersDuringInclude(boolean pAllow)
Method to allow/disallow changing headers on the response during an include.


setCharacterEncoding

public void setCharacterEncoding(java.lang.String pCharset)
Specified by:
setCharacterEncoding in interface javax.servlet.ServletResponse

isOutputStreamRetrieved

public boolean isOutputStreamRetrieved()