Package org.apache.catalina
Interface Response
-
- All Known Subinterfaces:
HttpResponse
- All Known Implementing Classes:
DummyResponse,HttpResponseWrapper,PECoyoteResponse,Response
public interface ResponseA Response is the Catalina-internal facade for aServletResponsethat is to be produced, based on the processing of a correspondingRequest.- Version:
- $Revision: 1.2 $ $Date: 2005/12/08 01:27:19 $
- Author:
- Craig R. McClanahan
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description jakarta.servlet.ServletOutputStreamcreateOutputStream()Create and return a ServletOutputStream to write the content associated with this Response.Stringencode(String url)Apply URL Encoding to the given URL without adding session identifier et al associated to this response.voidfinishResponse()Perform whatever actions are required to flush and close the output stream or writer, in a single operation.ConnectorgetConnector()Return the Connector through which this Response is returned.intgetContentCount()Return the number of bytes actually written to the output stream.intgetContentLength()Return the content length that was set or calculated for this Response.StringgetContentType()Return the content type that was set or calculated for this response, ornullif no content type was set.ContextgetContext()Return the Context with which this Response is associated.StringgetDetailMessage()Gets detail error message.booleangetIncluded()Return the "processing inside an include" flag.StringgetInfo()Return descriptive information about this Response implementation and the corresponding version number, in the format<description>/<version>.PrintWritergetReporter()Return a PrintWriter that can be used to render error messages, regardless of whether a stream or writer has already been acquired.RequestgetRequest()Return the Request with which this Response is associated.jakarta.servlet.ServletResponsegetResponse()Return theServletResponsefor which this object is the facade.OutputStreamgetStream()Return the output stream associated with this Response.booleanisAppCommitted()Application commit flag accessor.booleanisError()Error flag accessor.booleanisSuspended()Suspended flag accessor.voidrecycle()Release all object references, and initialize instance variables, in preparation for reuse of this object.voidresetBuffer()Reset the data buffer but not any status or header information.voidresetBuffer(boolean resetWriterStreamFlags)Reset the data buffer and the using Writer/Stream flags but not any status or header information.voidsendAcknowledgement()Send an acknowledgment of a request.voidsetAppCommitted(boolean appCommitted)Set the application commit flag.voidsetConnector(Connector connector)Set the Connector through which this Response is returned.voidsetContext(Context context)Set the Context with which this Response is associated.voidsetDetailMessage(String message)Sets detail error message.voidsetError()Set the error flag.voidsetIncluded(boolean included)Set the "processing inside an include" flag.voidsetRequest(Request request)Set the Request with which this Response is associated.voidsetStream(OutputStream stream)Set the output stream associated with this Response.voidsetSuspended(boolean suspended)Set the suspended flag.
-
-
-
Method Detail
-
getConnector
Connector getConnector()
Return the Connector through which this Response is returned.
-
setConnector
void setConnector(Connector connector)
Set the Connector through which this Response is returned.- Parameters:
connector- The new connector
-
getContentCount
int getContentCount()
Return the number of bytes actually written to the output stream.
-
getContext
Context getContext()
Return the Context with which this Response is associated.
-
setContext
void setContext(Context context)
Set the Context with which this Response is associated. This should be called as soon as the appropriate Context is identified.- Parameters:
context- The associated Context
-
setAppCommitted
void setAppCommitted(boolean appCommitted)
Set the application commit flag.- Parameters:
appCommitted- The new application committed flag value
-
isAppCommitted
boolean isAppCommitted()
Application commit flag accessor.
-
getIncluded
boolean getIncluded()
Return the "processing inside an include" flag.
-
setIncluded
void setIncluded(boolean included)
Set the "processing inside an include" flag.- Parameters:
included-trueif we are currently inside a RequestDispatcher.include(), elsefalse
-
getInfo
String getInfo()
Return descriptive information about this Response implementation and the corresponding version number, in the format<description>/<version>.
-
getRequest
Request getRequest()
Return the Request with which this Response is associated.
-
setRequest
void setRequest(Request request)
Set the Request with which this Response is associated.- Parameters:
request- The new associated request
-
getResponse
jakarta.servlet.ServletResponse getResponse()
Return theServletResponsefor which this object is the facade.
-
getStream
OutputStream getStream()
Return the output stream associated with this Response.
-
setStream
void setStream(OutputStream stream)
Set the output stream associated with this Response.- Parameters:
stream- The new output stream
-
setSuspended
void setSuspended(boolean suspended)
Set the suspended flag.- Parameters:
suspended- The new suspended flag value
-
isSuspended
boolean isSuspended()
Suspended flag accessor.
-
setError
void setError()
Set the error flag.
-
isError
boolean isError()
Error flag accessor.
-
setDetailMessage
void setDetailMessage(String message)
Sets detail error message.- Parameters:
message- detail error message
-
getDetailMessage
String getDetailMessage()
Gets detail error message.- Returns:
- the detail error message
-
createOutputStream
jakarta.servlet.ServletOutputStream createOutputStream() throws IOExceptionCreate and return a ServletOutputStream to write the content associated with this Response.- Throws:
IOException- if an input/output error occurs
-
finishResponse
void finishResponse() throws IOExceptionPerform whatever actions are required to flush and close the output stream or writer, in a single operation.- Throws:
IOException- if an input/output error occurs
-
getContentLength
int getContentLength()
Return the content length that was set or calculated for this Response.
-
getContentType
String getContentType()
Return the content type that was set or calculated for this response, ornullif no content type was set.
-
getReporter
PrintWriter getReporter() throws IOException
Return a PrintWriter that can be used to render error messages, regardless of whether a stream or writer has already been acquired.- Returns:
- Writer which can be used for error reports. If the response is not an error report returned using sendError or triggered by an unexpected exception thrown during the servlet processing (and only in that case), null will be returned if the response stream has already been used.
- Throws:
IOException- if an input/output error occurs
-
recycle
void recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object.
-
resetBuffer
void resetBuffer()
Reset the data buffer but not any status or header information.
-
resetBuffer
void resetBuffer(boolean resetWriterStreamFlags)
Reset the data buffer and the using Writer/Stream flags but not any status or header information.
-
sendAcknowledgement
void sendAcknowledgement() throws IOExceptionSend an acknowledgment of a request.- Throws:
IOException- if an input/output error occurs
-
-