com.ibm.websphere.servlet.response

Class StoredResponse

  1. java.lang.Object
  2. extended byHttpServletResponseWrapper
  3. extended bycom.ibm.websphere.servlet.response.StoredResponse
All implemented interfaces:
java.io.Serializable

  1. public class StoredResponse
  2. extends HttpServletResponseWrapper
  3. implements java.io.Serializable
StoredResponse is a response object that can be instantiated by any servlet and used/passed as a standard HttpResponse. The data that is written to this response will be stored for later use.

Constructor Summary

Constructor and Description
StoredResponse()
StoredResponse(boolean isInclude)
StoredResponse(IExtendedResponse extResponse,boolean isInclude)

Method Summary

Modifier and Type Method and Description
  1. void
addCookie(Cookie cookie)
  1. void
addDateHeader(java.lang.String name,long date)
  1. void
addHeader(java.lang.String name,java.lang.String value)
  1. void
addIntHeader(java.lang.String name,int value)
  1. void
addSessionCookie(Cookie cookie)
  1. void
alertClose()
  1. void
alertException()
  1. void
alertFirstFlush()
  1. void
alertFirstWrite()
  1. void
buildResponseData(IExtendedResponse response)
  1. void
buildWriterData(IExtendedResponse response)
  1. void
close()
  1. void
closeResponseOutput(boolean b)
  1. boolean
containsError()
Returns true if sendError() was called on this response.
  1. boolean
containsHeader(java.lang.String name)
  1. void
destroy()
  1. java.lang.String
encodeRedirectUrl(java.lang.String url)
  1. java.lang.String
encodeRedirectURL(java.lang.String url)
  1. java.lang.String
encodeUrl(java.lang.String url)
  1. java.lang.String
encodeURL(java.lang.String url)
  1. void
finish()
  1. void
fireOutputStreamRetrievedEvent(ServletOutputStream sos)
  1. void
fireWriterRetrievedEvent(java.io.PrintWriter pw)
  1. void
flushBuffer()
  1. void
flushBuffer(boolean flushToWire)
  1. java.util.Enumeration
getAddedHeaderNames()
Retrieve only the headers set in the include
  1. int
getBufferSize()
  1. java.util.List<WsByteBuffer>
getByteBufferList()
  1. java.lang.String
getCharacterEncoding()
Return the character encoding as specified in the charset flag of the content-type.
  1. java.lang.String
getContentType()
  1. Cookie[]
getCookies()
Return the cookies that were set using the addCookie() method.
  1. long
getDateHeader(java.lang.String name)
Retrieve a response header as a date.
  1. com.ibm.websphere.servlet.error.ServletErrorReport
getError()
  1. java.lang.String
getErrorMessage()
Returns the error message as reported by the sendError() method.
  1. int
getErrorStatusCode()
Returns the status code as reported by the sendError() method.
  1. java.lang.String
getHeader(java.lang.String name)
Retrieve a response header field by name.
getHeaderNames()
Retrieve the names of the header fields that have been set on this response.
  1. java.util.Vector[]
getHeaderTable()
  1. int
getIntHeader(java.lang.String name)
Retrieve a response header as an int.
  1. com.ibm.websphere.servlet.response.IResponse
getIResponse()
  1. long
getLastModified()
Returns the date that the data was last modifed in this response or -1 if unknown.
  1. java.util.Locale
getLocale()
  1. byte[]
getOutputBuffer()
  1. java.lang.String
getOutputBufferAsString()
Get the output from the response outputstream as a String.
  1. ServletOutputStream
getOutputStream()
  1. java.lang.String
getRedirectURI()
Returns the target URI of the redirect as specified by the sendRedirect() method.
  1. int
getStatusCode()
Returns the status code as specifed by the setStatus() method.
  1. java.lang.String
getStatusMessage()
Returns the status message as reported by the setStatus() method.
  1. java.io.PrintWriter
getWriter()
  1. void
initForNextResponse(com.ibm.websphere.servlet.response.IResponse res)
  1. boolean
isCommitted()
  1. boolean
isExpired()
Return true if the data in this response has expired.
  1. boolean
isOutputWritten()
  1. boolean
isRedirected()
Returns true if sendRedirect() was called.
  1. boolean
outputStreamObtained()
  1. void
registerOutputMethodListener(IOutputMethodListener listener)
  1. void
removeCookie(java.lang.String cookieName)
  1. void
reset()
  1. void
resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code.
  1. void
sendError(int sc)
  1. void
sendError(int sc,java.lang.String message)
  1. void
sendRedirect(java.lang.String uri)
  1. void
sendRedirect303(java.lang.String uri)
  1. void
setBufferSize(int size)
  1. void
setCharacterEncoding(java.lang.String encoding)
  1. void
setContentLength(int len)
  1. void
setContentType(java.lang.String type)
  1. void
setDateHeader(java.lang.String name,long value)
  1. void
setHeader(java.lang.String name,java.lang.String value)
  1. void
setHeader(java.lang.String name,java.lang.String value,boolean checkInclude)
  1. void
setInclude(boolean isInclude)
  1. void
setInternalHeader(java.lang.String name,java.lang.String value)
  1. void
setInternalHeaderSettable(boolean internalHeaderSettable)
  1. void
setIntHeader(java.lang.String name,int value)
  1. void
setLocale(java.util.Locale loc)
  1. void
setStatus(int sc)
  1. void
setStatus(int sc,java.lang.String message)
  1. void
start()
  1. void
transferResponse(HttpServletResponse target)
Copy the contents of this response to another HttpServletResponse.
  1. boolean
writerObtained()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StoredResponse

  1. public StoredResponse()

StoredResponse

  1. public StoredResponse(boolean isInclude)

StoredResponse

  1. public StoredResponse(IExtendedResponse extResponse,
  2. boolean isInclude)

Method Detail

writerObtained

  1. public boolean writerObtained()

outputStreamObtained

  1. public boolean outputStreamObtained( )

  1. public void addCookie(Cookie cookie)

getIResponse

  1. public com.ibm.websphere.servlet.response.IResponse getIResponse( )

getOutputStream

  1. public ServletOutputStream getOutputStream( )
  2. throws java.lang.IllegalStateException
  3. java.io.IOException
Throws:
java.lang.IllegalStateException
java.io.IOException

setContentLength

  1. public void setContentLength(int len)

setContentType

  1. public void setContentType(java.lang.String type)

setBufferSize

  1. public void setBufferSize(int size)
  2. throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getBufferSize

  1. public int getBufferSize()

flushBuffer

  1. public void flushBuffer()
  2. throws java.io.IOException
Throws:
java.io.IOException

flushBuffer

  1. public void flushBuffer(boolean flushToWire)
  2. throws java.io.IOException
Throws:
java.io.IOException

isCommitted

  1. public boolean isCommitted()

reset

  1. public void reset()
  2. throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getHeaderTable

  1. public java.util.Vector[] getHeaderTable( )

  1. public void addSessionCookie(Cookie cookie)

setLocale

  1. public void setLocale(java.util.Locale loc)

setCharacterEncoding

  1. public void setCharacterEncoding( java.lang.String encoding)

getLocale

  1. public java.util.Locale getLocale( )

addDateHeader

  1. public void addDateHeader(java.lang.String name,
  2. long date)

addHeader

  1. public void addHeader(java.lang.String name,
  2. java.lang.String value)

addIntHeader

  1. public void addIntHeader(java.lang.String name,
  2. int value)

setHeader

  1. public void setHeader(java.lang.String name,
  2. java.lang.String value)

setInternalHeader

  1. public void setInternalHeader(java.lang.String name,
  2. java.lang.String value)

setHeader

  1. public void setHeader(java.lang.String name,
  2. java.lang.String value,
  3. boolean checkInclude)

setIntHeader

  1. public void setIntHeader(java.lang.String name,
  2. int value)

setDateHeader

  1. public void setDateHeader(java.lang.String name,
  2. long value)

containsHeader

  1. public boolean containsHeader(java.lang.String name)

getWriter

  1. public java.io.PrintWriter getWriter( )
  2. throws java.io.IOException
  3. java.lang.IllegalStateException
Throws:
java.io.IOException
java.lang.IllegalStateException

setStatus

  1. public void setStatus(int sc)

setStatus

  1. public void setStatus(int sc,
  2. java.lang.String message)

sendError

  1. public void sendError(int sc)
  2. throws java.io.IOException
Throws:
java.io.IOException

sendError

  1. public void sendError(int sc,
  2. java.lang.String message)
  3. throws java.io.IOException
Throws:
java.io.IOException

encodeURL

  1. public java.lang.String encodeURL( java.lang.String url)

encodeUrl

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

sendRedirect

  1. public void sendRedirect(java.lang.String uri)
  2. throws java.io.IOException
Throws:
java.io.IOException

sendRedirect303

  1. public void sendRedirect303(java.lang.String uri)
  2. throws java.io.IOException
Throws:
java.io.IOException

encodeRedirectURL

  1. public java.lang.String encodeRedirectURL( java.lang.String url)

encodeRedirectUrl

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

finish

  1. public void finish()
  2. throws java.io.IOException
Throws:
java.io.IOException

close

  1. public void close()
  2. throws java.io.IOException
Throws:
java.io.IOException

getOutputBuffer

  1. public byte[] getOutputBuffer()
  2. throws java.io.IOException
Throws:
java.io.IOException

getByteBufferList

  1. public java.util.List<WsByteBuffer> getByteBufferList( )
  2. throws java.io.IOException
Throws:
java.io.IOException

getOutputBufferAsString

  1. public java.lang.String getOutputBufferAsString( )
  2. throws java.io.IOException
Get the output from the response outputstream as a String. This method should only be used to retrieve content that is known to be text based. Using this method to retrieve binary data will corrupt the response data.
Throws:
java.io.IOException

getHeaderNames

  1. public getHeaderNames()
Retrieve the names of the header fields that have been set on this response.

getAddedHeaderNames

  1. public java.util.Enumeration getAddedHeaderNames( )
Retrieve only the headers set in the include

getHeader

  1. public java.lang.String getHeader( java.lang.String name)
Retrieve a response header field by name.

getIntHeader

  1. public int getIntHeader(java.lang.String name)
Retrieve a response header as an int.

getDateHeader

  1. public long getDateHeader(java.lang.String name)
Retrieve a response header as a date.

containsError

  1. public boolean containsError()
Returns true if sendError() was called on this response.

getError

  1. public com.ibm.websphere.servlet.error.ServletErrorReport getError( )

getErrorMessage

  1. public java.lang.String getErrorMessage( )
Returns the error message as reported by the sendError() method.

getErrorStatusCode

  1. public int getErrorStatusCode()
Returns the status code as reported by the sendError() method.

getStatusCode

  1. public int getStatusCode()
Returns the status code as specifed by the setStatus() method.

getStatusMessage

  1. public java.lang.String getStatusMessage( )
Returns the status message as reported by the setStatus() method.

getRedirectURI

  1. public java.lang.String getRedirectURI( )
Returns the target URI of the redirect as specified by the sendRedirect() method.

isRedirected

  1. public boolean isRedirected()
Returns true if sendRedirect() was called.

getCharacterEncoding

  1. public java.lang.String getCharacterEncoding( )
Return the character encoding as specified in the charset flag of the content-type.

getContentType

  1. public java.lang.String getContentType( )

getCookies

  1. public Cookie[] getCookies()
Return the cookies that were set using the addCookie() method.

getLastModified

  1. public long getLastModified()
Returns the date that the data was last modifed in this response or -1 if unknown. This method returns the date value specified in the last-modified header.

isExpired

  1. public boolean isExpired()
Return true if the data in this response has expired. This method is useful for caches to determine if the response is up-to-date or if if it should be cleared from the cache. This method returns false by default, subclasses should overload this method to provide their own expiration policies.

transferResponse

  1. public void transferResponse(HttpServletResponse target)
  2. throws java.io.IOException
Copy the contents of this response to another HttpServletResponse. This method is optimized to quickly transfer the contents of this response into another response. This method is useful when this response is cached to generate the same response later.
Throws:
java.io.IOException

resetBuffer

  1. public void resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code.
Since:
2.3

fireOutputStreamRetrievedEvent

  1. public void fireOutputStreamRetrievedEvent( ServletOutputStream sos)

fireWriterRetrievedEvent

  1. public void fireWriterRetrievedEvent( java.io.PrintWriter pw)

registerOutputMethodListener

  1. public void registerOutputMethodListener( IOutputMethodListener listener)

destroy

  1. public void destroy()

initForNextResponse

  1. public void initForNextResponse( com.ibm.websphere.servlet.response.IResponse res)

start

  1. public void start()

setInclude

  1. public void setInclude(boolean isInclude)

setInternalHeaderSettable

  1. public void setInternalHeaderSettable( boolean internalHeaderSettable)

buildResponseData

  1. public void buildResponseData(IExtendedResponse response)

buildWriterData

  1. public void buildWriterData(IExtendedResponse response)

alertClose

  1. public void alertClose()

alertException

  1. public void alertException()

alertFirstFlush

  1. public void alertFirstFlush()

alertFirstWrite

  1. public void alertFirstWrite()

closeResponseOutput

  1. public void closeResponseOutput( boolean b)

removeCookie

  1. public void removeCookie(java.lang.String cookieName)

isOutputWritten

  1. public boolean isOutputWritten( )