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